Skip to content

Instantly share code, notes, and snippets.

View gautamk's full-sized avatar

Gautam gautamk

  • Block | Meta | Appdynamics | Cisco | Amazon | University of Washington
  • PST
View GitHub Profile
@gautamk
gautamk / android_hands-on_requirements.md
Created July 29, 2012 12:47
Requirements for android custom views hands on presentation.

Android Hands-on Building Custom Views

Personal Requirements

  • A good understanding of Java
  • Basic working knowledge of android (at least a Hello World program)

Software Requirements

  • Eclipse 3.6+ (recommended eclipse 4.2 Juno)
  • Android ADT plugin 15+ (recommended ADT 20)
  • Android SDK for Gingerbread (API Level 9)
@gautamk
gautamk / download.gitignore.py
Created October 10, 2012 10:54
Download .gitignore files from github
#!/usr/bin/env python
import sys,urllib2,json
data={}
raw_data = "raw_data"
parsed_data = "parsed_data"
file_names = "file_names"
def exit():
sys.exit("----")
@gautamk
gautamk / download.gitignore.py
Created October 10, 2012 10:54
Download .gitignore files from github
#!/usr/bin/env python
import sys,urllib2,json
data={}
raw_data = "raw_data"
parsed_data = "parsed_data"
file_names = "file_names"
def exit():
sys.exit("----")
@gautamk
gautamk / gist:4617487
Created January 24, 2013 03:48
MTC Scraper Description
Ever wanted an api to access the various information about transportation options in chennai ? Well this is it.
This project does the heavy lifting so you don't have to . It also makes me look cool because its written clojure.
The project is available at https://github.com/gautamk/mtc-scraper
@gautamk
gautamk / infinite-loop.sh
Last active December 13, 2015 21:09
infinite loop a command
#!/bin/bash
while true
do
now=$(date +"%T")
wait
notify-send "Pre-execute $now";
wait
@gautamk
gautamk / monitorchanges.sh
Created February 18, 2013 07:10
monitor for file changes and loop
#!/bin/bash
while true
do
inotifywait . -e modify -r
wait
now=$(date +"%T")
wait
@gautamk
gautamk / gist:5794766
Last active December 18, 2015 14:08
assertEquals of Json strings by parsing into hashmaps using Jackson
private static void assertEqualsJson(String expectedJson,String actualJson){
final ObjectMapper objectMapper = new ObjectMapper();
Map<String,Object> expected = null,actual = null;
try {
expected = objectMapper.readValue(expectedJson, new TypeReference<Map<String, Object>>() {});
actual = objectMapper.readValue(actualJson, new TypeReference<Map<String, Object>>() {});
} catch (IOException e) {
e.printStackTrace();
//http://blog.kevburnsjr.com/javascript-asynchronous-rsa-key-generation
//http://kjur.github.io/jsrsasign/api/symbols/RSAKey.html
function xeroTest() {
var oauth_nonce = createGuid();
var oauth_timestamp = (new Date().valueOf()/1000).toFixed(0);
var signatureBase = "GET" + "&"
+ encodeURIComponent("https://api.xero.com/api.xro/2.0/Organisation") + "&"
+ encodeURIComponent("oauth_consumer_key=" + UserProperties.getProperty("consumerKey") + "&oauth_nonce="+oauth_nonce+"&oauth_signature_method=RSA-SHA1&oauth_timestamp="+oauth_timestamp+"&oauth_token=" + UserProperties.getProperty("consumerKey") + "&oauth_version=1.0");
@gautamk
gautamk / hs.js
Created September 13, 2013 13:47
[][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+!+[]]]]][([][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+!+[]]]]]+[])[+[[!+[]+!+[]+!+[]]]]+([][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+!+[]]]]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]+!+[]]]]+([][[]]+[])[+[[+!+[]]]]+(![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[+!+[]]]]+([][[]]+[])[+[[+[]]]]+([][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+!+[]]]]]+[])[+[[!+[]+!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+([][(![]+[])[+[[+[]]]]+([][[]]+[])[+[[!+[]+!+[]+!+[]+!+[]+!+[]]]]+(![]+[])[+[[!+[]+!+[]]]]+(!![]+[])[+[[+[]]]]+(!![]+[])[+[[!+[]+!+[]+!+[
@gautamk
gautamk / oneTouch2Monas.py
Created January 30, 2015 01:48
Convert One Touch Expenser export csv to Monas import csv
import csv
from datetime import datetime
with open('expenses.csv','r') as input_csv_file:
csv_reader =csv.DictReader(input_csv_file,fieldnames=['Date','Amount','Note','Tag'], delimiter=';')
csv_reader.next()
with open('monas.csv','w') as output_csv_file:
output_csv_file.write('"Date (MM/DD/YYYY)","Category","Amount","Note"\n')
writer = csv.DictWriter(output_csv_file,
fieldnames=["Date (MM/DD/YYYY)","Category","Amount","Note"],quotechar='"')