Skip to content

Instantly share code, notes, and snippets.

@gsathya
gsathya / tail.py
Created January 16, 2012 17:49 — forked from shadeslayer/tail.py
import sys
import linecache
import os
if os.path.isfile(sys.argv[1]):
try:
with open(sys.argv[1], 'r') as f:
content = f.readlines()
length = len(content)
except IOError as e:
If you look at a list of US cities sorted by population, the number of successful startups per capita varies by orders of magnitude. Somehow it's as if most places were sprayed with startupicide.
I wondered about this for years. I could see the average town was like a roach motel for startup ambitions: smart, ambitious people went in, but no startups came out. But I was never able to figure out exactly what happened inside the motel—exactly what was killing all the potential startups.
A couple weeks ago I finally figured it out. I was framing the question wrong. The problem is not that most towns kill startups. It's that death is the default for startups, and most towns don't save them. Instead of thinking of most places as being sprayed with startupicide, it's more accurate to think of startups as all being poisoned, and a few places being sprayed with the antidote.
Startups in other places are just doing what startups naturally do: fail. The real question is, what's saving startups in places like Silicon
;; Load Path
(add-to-list 'load-path "~/.emacs.d/")
(add-to-list 'load-path "/usr/share/emacs/site-lisp/")
;; Change directory for auto-save files
(setq backup-directory-alist
`((".*" . ,temporary-file-directory)))
(setq auto-save-file-name-transforms
`((".*" ,temporary-file-directory t)))
@gsathya
gsathya / hackfest.textile
Created October 3, 2011 18:27
Event Format

Hackfest

Introduction -

A two/three night hackathon on free and open source software[Ex. Gnome, KDE, Wikimedia].
Mentors who have been contributing to said foss projects help new hackers get
started by giving them a primer on -

  • Intro to FOSS – the philosophy of that project
  • Download the source – using version control
@gsathya
gsathya / OrlibRoutingCode.java
Created September 2, 2011 15:21
Routing through orbot
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://blip.tv/file/post");
HttpHost proxy = new HttpHost("localhost", 8118);
httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
@gsathya
gsathya / AnonBlipTVUploader.diff
Created September 2, 2011 15:04
GSoC work on Orbot
commit c732680861e7f9f8a6983c21d5eeaf0bd3c5491a
Author: Sathyanarayanan Gunasekaran <[email protected]>
Date: Sat Aug 13 14:40:19 2011 +0530
Added progress bar dialog + new home screen
diff --git a/bin/BlipTVUploader.apk b/bin/BlipTVUploader.apk
index 37b1515..c81658b 100644
Binary files a/bin/BlipTVUploader.apk and b/bin/BlipTVUploader.apk differ
diff --git a/bin/classes.dex b/bin/classes.dex
@gsathya
gsathya / about.md
Created August 9, 2011 23:53 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
@gsathya
gsathya / beats.rb
Created July 28, 2011 17:54
Beats Time
Shoes.app :width => 300, :height => 100 do
def calc_time
t = Time.new.utc.to_i%86400
t = t.to_s
t = "@ "+t[0..2]+" : "+t[3..5]
end
background "#BE8"
stack do
@title = title "New Internet Time!",
:align => "center",
@gsathya
gsathya / problems.textile
Created June 9, 2011 20:06
Problems with the wizard

Intro + Warning screenFIXED

  • BUG – When activity is restarted when viewing “warning” screen, intro screen is displayed instead.
  • Dirty flag variable approach won’t work – need to use SharedPreferences

Permissions screen

  • “next” button needs to be made un-clickable – my code needs review – doesn’t seem to work(Not sure, why though)FIXED
  • TorTransProxy.testOwnerModule(this) is called in the stepThree() – before pressing “Grant Permissions” – causes lag – should this be called later when the “Grant Permissions” button is pressed ?
  • Check flow of logic
@gsathya
gsathya / wizardActivity.java
Created June 2, 2011 17:24
This is the one I wrote
package org.torproject.android;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;