Skip to content

Instantly share code, notes, and snippets.

View rikwatson's full-sized avatar

Rik Watson rikwatson

View GitHub Profile
def explain!
puts 'Want to embed this Gist?'
puts 'Use this: <script src="http://gist.github.com/2059.js"></script>'
end
explain!
@mathiasbynens
mathiasbynens / appify
Created November 12, 2010 13:46 — forked from subtleGradient/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
@jonah-williams
jonah-williams / build.sh
Created April 30, 2011 17:46
Command line iOS project builds and over-the-air distribution
#!/bin/bash
# https://gist.github.com/949831
# http://blog.carbonfive.com/2011/05/04/automated-ad-hoc-builds-using-xcode-4/
# command line OTA distribution references and examples
# http://nachbaur.com/blog/how-to-automate-your-iphone-app-builds-with-hudson
# http://nachbaur.com/blog/building-ios-apps-for-over-the-air-adhoc-distribution
# http://blog.octo.com/en/automating-over-the-air-deployment-for-iphone/
# http://www.neat.io/posts/2010/10/27/automated-ota-ios-app-distribution.html
@chrishulbert
chrishulbert / swiperama.m
Created May 6, 2011 04:36
How to make an iphone view controller detect left or right swipes
- (void)swipeLeft {
NSLog(@"Left!");
}
- (void)swipeRight {
NSLog(@"Right!");
}
- (void)viewDidLoad
{
[super viewDidLoad];
#!/bin/sh
ffmpeg -i “$1″ -acodec alac “`basename “$1″ .flac`.m4a” \
-metadata title=\”"$(metaflac –show-tag=TITLE “$1″ | sed ‘s/title=//g’)”\” \
-metadata author=\”"$(metaflac –show-tag=ARTIST “$1″ | sed ‘s/artist=//g’)”\” \
-metadata album=\”"$(metaflac –show-tag=ALBUM “$1″ | sed ‘s/album=//g’)”\” \
-metadata year=\”"$(metaflac –show-tag=DATE “$1″ | sed ‘s/date=//g’)”\” \
-metadata track=\”"$(metaflac –show-tag=TRACKNUMBER “$1″ | sed ‘s/tracknumber=//g’)”\” \
-metadata genre=\”"$(metaflac –show-tag=GENRE “$1″ | sed ‘s/genre=//g’)”\”
@douglas
douglas / update_git_repos.sh
Created October 14, 2011 15:04
Update all git repositories under a base directory
#!/bin/bash
# store the current dir
CUR_DIR=$(pwd)
# Let the person running the script know what's going on.
echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n"
# Find all git repositories and update it to the master latest revision
for i in $(find . -name ".git" | cut -c 3-); do
@paulirish
paulirish / data-markdown.user.js
Last active February 6, 2024 10:41
*[data-markdown] - use markdown, sometimes, in your HTML
// ==UserScript==
// @name Use Markdown, sometimes, in your HTML.
// @author Paul Irish <http://paulirish.com/>
// @link http://git.io/data-markdown
// @match *
// ==/UserScript==
// If you're not using this as a userscript just delete from this line up. It's cool, homey.
@wrunk
wrunk / python_yaml_example.py
Created June 19, 2012 00:02
Quick python example of using yaml
'''
This is a quick reference example to get you started with yaml. Please review this,
but spend the time to fully read the wikipedia page on yaml:
http://en.wikipedia.org/wiki/Yaml
Note that the magic quote-less yaml parsing will still always strip values.
To avoid this you need to use quotes. Quotes can also force types to string type,
and are always valid (meaning omitting quotes is for convenience not necessity).
'''
@idan
idan / gist:3135754
Created July 18, 2012 11:50
A Sample Post

Hello there! This is a sample post for gist.io, a super-lightweight writing soapbox for hackers.

Now look up. Further. Above the post title. See that grey text with the gist ID?

Now back to me. That grey text is a link! Open that sucker in a new tab to see the source for this post. Also, I'm on a horse.

This is a major heading

If you peek at it with a web inspector, you'll see that it is a second-level heading. You can use first level headings, but they'll look just like the second level ones, and the gods of the HTML5 outlining algorithm will frown upon you.

set backspace=indent,eol,start
set incsearch
set noshowmatch
nohlsearch
set ruler
set smartcase
syntax on
set softtabstop=4
set shiftwidth=4