Dec 9, 2013

Bash shell trick: searching interactively through command history

Although the up/down arrow are nice to move through commands in a Bash shell, searching takes the command history to a whole new level.

To start a search within Bash, enter Control-R, the prompt will then change to look as follows:

(reverse-i-search)`':

As you type, matches will be shown, with the cursor directly on the character where the match occurs.

- Hit enter to run the command as is
- Hit Command-R to find more matches
- Type (or delete) characters to refine search
- Type left or right arrow key to edit command (before running)

Dec 4, 2013

Python and asynchronous I/O with Tulip [video]

Guido van Rossum, creator of Python talks about the addition of synchronous I/O to the Python standard library:

Tulip is included in Python 3.4

Software update framework for OS X applications

Andy Matuschak is the author of Sparkle, a framework to help with software updates of Cocoa (OS X) applications.

True self-updating–no work required from the user. Supports bundles, preference panes, plugins, and other non-.app software. Deep delegate support to make Sparkle work exactly as you need.

Sparkle is used in many familiar OS X apps including Textmate, Evernote, Adium, Handbrake, among many others.

Dec 3, 2013

Resolving code signing issues in Xcode 5.0

Upgrade to Mavericks? Any chance you’ve seen this or something similar when attempting to sign an app:

code failed to satisfy specified code requirement(s)

Olivier HO-A-CHUCK:

If you have recently updated you Xcode version and your favorite re-signing script suddenly does not work…then it might be possible that you have to change codesign_allocate path on your environment variable.

Oliver shares the codesign allocate paths for the various versions of Xcode and includes a shell script to export the appropriate setting based on the version of Xcode installed.

Dec 2, 2013

Using Objective-C objects in AppleScript

AppleScript certainly has its place, however, the language itself leaves a little to be desired. With that said, how can one not be intrigued by the idea of Objective-C objects in AppleScript?

Don Southard:

The framework AppleScriptObjC allows users to write scripts with an interesting fusion of the AppleScript and Objective-C languages.

Basically this means that you can use simplistic Objective-C code in an AppleScript with the seemingly easier to grasp syntax of AppleScript.

If you are familiar with Objective-C and AppleScript, check it out.

Xcodebuild alternative for more effective build and test cycles

xctool is an open source project from Facebook:

xctool is a replacement for Apple’s xcodebuild that makes it easier to build and test iOS and Mac products. It’s especially helpful for continuous integration.

One feature of xctool that rules is the output – Colored text and a clean, readable display make it much easier to find problems.

Nov 25, 2013

Submit issues ‘while you code’ in Ruby or Perl

Nima H. Mood:

watson is a tool for creating and tracking bug reports, issues, and internal notes in code. It is avaliable in two flavors, watson-ruby and watson-perl

Shell scripting: Creating sequential numbers and text

From jot man page:

The jot utility is used to print out increasing, decreasing, random, or redundant data, usually numbers, one per line.

I use jot within bash to provide sequences of both numbers and text, the later is really handy for generating a series of filenames.

The posts below include several examples of jot:

The Multipurpose jot Command
A primer on using jot

Nov 22, 2013

User defined literals in Objective-C

Dustin Bachrach:

OCUDL is an experiment to bring user defined literals to Objective-C. A literal is a shorthand expression that creates a value of a certain type. For example, 25ul creates an unsigned long of 25, and @”hello” creates an NSString of hello. User defined literals bring this brevity and expressivity to our own types.

Dustin has a post that is well worth reading that describes the details of OCUDL.

Nov 21, 2013

Learn git via this open source game

New to git? Gary Rennie is the developer of githug:

Githug is designed to give you a practical way of learning git. It has a series of levels, each utilizing git commands to ensure a correct answer.

And if you are so inclined, you can also write you own game levels through the embedded DSL.

Simplified auto layout on OS X and iOS

Jonas Budelmann on his open source project Masonry:

Harness the power of AutoLayout NSLayoutConstraints with a simplified, chainable and expressive syntax. Supports iOS and OSX Auto Layout.

Nov 20, 2013

Open source mind mapping app for OS X

Tae Won Ha is the author of QMind:

Qmind is a mind mapping app for your Mac which is meant to be compatible to FreeMind.

Full Objective-C source code is included.

Python imaging library

Alex Clark is the man behind Pillow:

The Python Imaging Library is ideal for for image archival and batch processing applications. You can use the library to create thumbnails, convert between file formats, print images, etc.

Pillow was forked from PIL to provide consistent updates and compatibility with setup tools such as homebrew on Mac.

Nov 19, 2013

Create UML diagram from Xcode project

You can create a UML diagram automagically by dragging/dropping an Xcode project onto OmniGraffle. I’ve been using this for years, and just recently tried with Xcode 5, worked like a champ.

Open source NSCollectionView replacement

Frank Gregor:

CNGridView is a (wanna be) replacement for NSCollectionView. It has full delegate and dataSource support with method calls just like known from NSTableView and UITableView.

Interesting project. Includes the caveat (which should be included in many early draft open source implementations):

The code is provided as-is, and it is far off being complete or free of bugs.

cURL library in an Objective-C wrapper

Last week I posted about an open source cURL library. Dan Wood reached out to let me know about CURLHandle:

CURLHandle is a high level Objective-C interface to the libcurl library. It was originally created by Dan Wood of Karelia Software, way back in the mists of time, when dinosaurs still roamed the earth (ok, sometime around 2001).

Nov 18, 2013

Fast Base64 encoding in C

David Lazar on his open source base64 encoding:

The C code in base64encode.c is a fast implementation of Base64 encoding. It is based on libb64, which uses coroutines to achieve speed. The nontrivial control-flow of this code makes proving it correct more challenging.

The writeup includes background information on “the proof” verifying the C implementation.

The code is available on github.

Python on a microcontroller

Damien George on his KickStarter campaign:

Running on a small microcontroller, Micro Python allows you to effortlessly blink LEDs, read voltages, make motors and servos move, play sounds, write data to SD cards, communicate wirelessly, and be the brains of your robot, among countless other things.

Damien re-wrote Python from the bottom up to make it possible to run Python on a microcontroller, and ultimately, to combine his passion for robotics and Python.