Skip to content

Instantly share code, notes, and snippets.

@aurels
aurels / gist:843967
Created February 25, 2011 15:45
stream system command output to STDOUT (ruby)
IO.popen('ant run') do |io|
while (line = io.gets) do
puts line
end
end
@pec1985
pec1985 / customnav.js
Created June 22, 2011 15:24
Custom Navigation Controller, compatible with Android and iPhone
// Flags, is this for Android or iPhone?
var iPhone = false;
var Android = false;
if(Ti.Platform.osname == 'iphone'){
iPhone = true
};
if(Ti.Platform.osname == 'android'){
Android = true
};
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active March 27, 2024 06:33
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@qtproduction
qtproduction / scrape.py
Created September 26, 2012 12:41
Retrive website from Google Cache without blocking IP
#Retrive old website from Google Cache. Optimized with sleep time, and avoid 504 error (Google block Ip send many request).
#Programmer: Kien Nguyen - QTPros http://qtpros.info/kiennguyen
#change search_site and search_term to match your requirement
#Original: http://www.guyrutenberg.com/2008/10/02/retrieving-googles-cache-for-a-whole-website/
#!/usr/bin/python
import urllib, urllib2
import re
import socket
anonymous
anonymous / gist:4567542
Created January 18, 2013 19:23
Reads a random Urban Dictionary Definition (Must be run from a Mac OS X Terminal)
curl -L www.urbandictionary.com/random.php | awk '$0 ~ /(<title>)|(\<div class\=\"definition\"\>)/{print}' | sed -e 's#<[^>]*>##g' | sed 's/Urban Dictionary\:\(.*\)/\1\, Definition:/' | say
@zackdever
zackdever / gist:8701478
Created January 30, 2014 02:23
arc diff off another diff
taken directly from https://sites.google.com/a/khanacademy.org/forge/for-developers/code-review-policy/using-phabricator
Advanced topic: Dependent Phabricator reviews
Say you have an upstream called master, and a feature branch F1, and a second change that depends on F1, (call it F2).
git checkout master
git checkout -b F1
# work work
git commit -a
arc diff
@natelandau
natelandau / .bash_profile
Last active March 20, 2024 22:19
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@tamoyal
tamoyal / gist:a2fd3d76f6327d8e963f5136291c073d
Created September 17, 2021 23:52
For batch converting aif to mp3 and keeping original filename
for f in *.aif;
do
ffmpeg -i "$f" -f mp3 -acodec libmp3lame -ab 192000 -ar 44100 "${f%.aif}".mp3;
done