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
### Keybase proof | |
I hereby claim: | |
* I am funkaoshi on github. | |
* I am funkaoshi (https://keybase.io/funkaoshi) on keybase. | |
* I have a public key whose fingerprint is BBBC 136E 4036 5070 D219 AE3D 09B9 4D37 D8E6 9C6D | |
To claim this, I am signing this object: |
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
# mh theme | |
# preview: http://cl.ly/1y2x0W0E3t2C0F29043z | |
# features: | |
# path is autoshortened to ~30 characters | |
# displays git status (if applicable in current folder) | |
# turns username green if superuser, otherwise it is white | |
# if superuser make the username green | |
if [ $UID -eq 0 ]; then NCOLOR="green"; else NCOLOR="white"; fi |
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 classproperty(property): | |
""" | |
Marries @property and @classmethod | |
Why doesn't python have this? Grr.. | |
""" | |
def __new__(cls, fget, *args): | |
return super(classproperty, cls).__new__(cls, classmethod(fget), *args) | |
def __get__(self, obj, type=None): | |
return self.fget(type) |
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
#include "unistd.h" | |
#include "stdio.h" | |
/* Reads one line of data and produces the LRC of all the bytes read. */ | |
int main ( int argc, char* argv[] ) | |
{ | |
char buf[1]; | |
int n, lrc = 0; | |
while ( n = read(0, buf, 1) > 0 ) /* read one byte from std::in */ | |
{ |
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
/* Stations on the Yonge/Spadina/Sheppard Subway Line */ | |
static const char* stationNamesYongeSpadinaSheppard = | |
[ | |
"Bayview", "Bessarion", "BloorYonge", "College", "Davisville", "DonMills", | |
"Downsview", "Dundas", "Dupont", "Eglinton", "EglintonWest", "Finch", | |
"Glencairn", "King", "Lawrence", "LawrenceWest", "Leslie", "Museum", | |
"NorthYorkCentre", "Osgoode", "Queen", "Queen'sPark", "Rosedale", | |
"SheppardYonge", "Spadina", "StAndrew", "StClair", "StClairWest", | |
"StGeorge", "StPatrick", "Summerhill", "Union", "Wellesley", "Wilson", | |
"YorkMills", "Yorkdale" |
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 | |
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/Users/ramanan/local/bin:$PATH" | |
# dump database, downlaod it locally, restore it over local copy | |
# of the database. Everything is done in /tmp/ | |
cd /tmp/ | |
# cd to the tmp directory on funkaoshi.com; dump the database | |
# out of mysql, and gzip it up. |
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
ENV['GEM_HOME'] = '/home/ramanan/local/gems' | |
ENV['GEM_PATH'] = '$GEM_HOME:/usr/lib/ruby/gems/1.8' | |
require 'rubygems' | |
Gem.clear_paths | |
require 'vendor/sinatra/lib/sinatra.rb' | |
Sinatra::Base.set(:run, false) | |
Sinatra::Base.set(:env, :production); |
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
property archiveFilePath : "/Users/ramanan/Dropbox/SimpleText/Archive.taskpaper" | |
property archiveFileName : "Archive.taskpaper" | |
tell application "Finder" | |
if exists (archiveFilePath) as POSIX file then | |
tell application "TaskPaper" | |
-- save what the front most file is | |
set currentFile to front document | |
-- open archive file |
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
// http://1kbgrid.com as a sass file. | |
// | |
// To use, import this file into another sass file that sets all the variables. | |
// For example, I use this within the following sass file to generate the grid | |
// for my iPhone blog | |
// | |
// !column_width = 40px | |
// !gutter_width = 20px | |
// !number_of_columns = 11 | |
// |
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
property archiveFilePath : "/Users/ramanan/Desktop/Text Files/SimpleText/Archive.taskpaper" | |
property archiveFileName : "Archive.taskpaper" | |
tell application "Finder" | |
if exists (archiveFilePath) as POSIX file then | |
tell application "TaskPaper" | |
-- save what the front most file is | |
set currentFile to front document | |
-- open archive file |
OlderNewer