This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def truncate_description(length, end_string = ' ...') | |
words = description.split() | |
words = words[0..(length-1)].join(' ') + (words.length > length ? end_string : '') | |
words | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PkgCurlDownloadStrategy <CurlDownloadStrategy | |
def stage | |
safe_system '/usr/sbin/pkgutil', '--extract', @tarball_path, File.basename(@url) | |
chdir | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(IBAction)genericPressed:(id)sender { | |
[theImage setImage:[UIImage imageNamed:[NSString stringWithFormat:@"bg1_%@.png", sender]]]; | |
} |
OlderNewer