Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Ramanan Sivaranjan funkaoshi

🏠
Working from home
Block or report user

Report or block funkaoshi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View lrc_calc.c
#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 */
{
@funkaoshi
funkaoshi / gist:145786
Created Jul 12, 2009
TTC Subway/RT Travel Times
View gist:145786
/* 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"
@funkaoshi
funkaoshi / funkaoshi.com backup
Last active Sep 4, 2015
funkaoshi.com backup script.
View funkaoshi.com backup
#!/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.
View blansdowne rackfile
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);
View Archive Done Taskpaper Tasks in Archive File
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
View 1kbgrid.sass
// 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
//
View Move Archived.scpt
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
@funkaoshi
funkaoshi / nko_spam_blocker_blacklist.php
Created Apr 12, 2010
nko_spamurl_blocker blacklist
View nko_spam_blocker_blacklist.php
// blacklist for nko_spamurl_blocker pluging
$finder[] = '[/link]';
$finder[] = '[/url]';
$finder[] = '[/url ]';
$finder[] = '<a href= ';
$finder[] = '<a href=';
$finder[] = '<a href=';
$finder[] = '&lt;a href=&#8220;';
$finder[] = '&lt;a href=&#8221;';
@funkaoshi
funkaoshi / gist:1262847
Created Oct 4, 2011
My post-review alias
View gist:1262847
alias pr='post-review --bugs-closed=$(git name-rev --name-only HEAD | sed "s/\(.*\)\([0-9][0-9][0-9][0-9]\)\(.*\)/\2/") --branch=$(git name-rev --name-only HEAD) --tracking-branch=origin/develop --guess-description --guess-summary --open'
View gist:3668265
If I am making a new class that inherits from an old library that
doesn't have object as its base class (doesn't use the new-style
classes), is it recommended that I add object as an additional
parent like this:
Class MyNewClass(OldStyleClass, object):
and then use super, or stick to the old style and call the init
like:
You can’t perform that action at this time.