Skip to content

Instantly share code, notes, and snippets.

View leepa's full-sized avatar

Lee Packham leepa

View GitHub Profile
-(IBAction)genericPressed:(id)sender {
[theImage setImage:[UIImage imageNamed:[NSString stringWithFormat:@"bg1_%@.png", sender]]];
}
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index 61a2a2d..228e1d5 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -29,7 +29,12 @@ class Pathname
if src.is_a? Array
src.collect {|src| install src }
else
- raise "#{src} does not exist" unless File.exist? src
+ # if it's a symlink, don't resolve it to a file because if we are moving
class PkgCurlDownloadStrategy <CurlDownloadStrategy
def stage
safe_system '/usr/sbin/pkgutil', '--extract', @tarball_path, File.basename(@url)
chdir
end
end
#!/usr/local/bin/bash
INPUT="$1"
OUTPUT="$2"
VIDEO_CODEC="mpeg2video"
VIDEO_FPS=`mkvinfo $1 | grep -A 10 'Codec ID: V_MPEG4' | grep -w fps | awk '{print $6}' | cut -d'(' -f2`
mkvinfo $INPUT | grep -qE 'Codec ID.*DTS'
if [ $? -eq 0 ]; then
#!/bin/sh -
"exec" "python" "-O" "$0" "$@"
__doc__ = """Tiny HTTP Proxy.
This module implements GET, HEAD, POST, PUT and DELETE methods
on BaseHTTPServer, and behaves as an HTTP proxy. The CONNECT
method is also implemented experimentally, but has not been
tested yet.
import struct
from socket import socket
import ssl
import binascii
payload = '{"aps":{"alert":"Hello World","sound":"chime"}}'
fmt = "!cH32sH%ds" % len(payload)
command = '\x00'
token = '<<removed>>'
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(git::\1)/'
}
parse_svn_branch() {
parse_svn_url | sed -e 's#^'"$(parse_svn_repository_root)"'##g' | awk -F / '{print "(svn::"$1 "/" $2 ")"}'
}
parse_svn_url() {
svn info 2>/dev/null | grep -e '^URL*' | sed -e 's#^URL: *\(.*\)#\1#g '
}
parse_svn_repository_root() {
[14:10:15] <Tikcus> Five surgeons from big cities are discussing who makes the best patients to operate on...
[14:10:17] <Tikcus> The first surgeon, from Bristol , says, "I like to see accountants on my operating table, because when you open them up, everything inside is numbered."
[14:10:19] <Tikcus> The second, from Manchester , responds, "Yeah, but you should try electricians! Everything inside them is colour coded."
[14:10:21] <Tikcus> The third surgeon, from Edinburgh , says, "No, I really think librarians are the best, everything inside them is in alphabetical order."
[14:10:23] <Tikcus> The fourth surgeon, from Birmingham chimes in: "You know, I like construction workers...those blokes always understand when you have a few parts left over."
[14:10:25] <Tikcus> But the fifth surgeon, from London shut them all up when he observed: "You're all wrong, Politicians are the easiest to operate on"...............................
[14:10:27] <Tikcus> .................................."There's no guts, no heart, n
def truncate_description(length, end_string = ' ...')
words = description.split()
words = words[0..(length-1)].join(' ') + (words.length > length ? end_string : '')
words
end
#!/usr/bin/env ruby
=begin
INSTALL:
curl http://github.com/defunkt/gist/tree/master%2Fgist.rb?raw=true > gist &&
chmod 755 gist &&
sudo mv gist /usr/local/bin/gist