Skip to content

Instantly share code, notes, and snippets.

View sumchattering's full-sized avatar
🎯
Focusing

Sumeru Chatterjee sumchattering

🎯
Focusing
View GitHub Profile
# To check if this is up-to-date with the tax rates go to
# http://www.expatax.nl/tax_rates_2013.php and see if there's anything
# newer there.
use strict;
use warnings;
use Text::TabularDisplay;
use List::Util qw(sum);
my $start = 30_000 || $ARGV[0];
my $end = 100_000 || $ARGV[1];
@sumchattering
sumchattering / sniff_objc_exception_throw.py
Created November 19, 2013 11:31
Python Script for Sniffing Objective C Exception
import lldb
def GetFirstArgumentAsValue(target, frame):
# Note: I assume the PC is at the first instruction of the function, before the stack and registers have been modified.
if target.triple.startswith('x86_64'):
return frame.regs[0].GetChildMemberWithName("rdi")
elif target.triple.startswith('i386'):
espValue = frame.regs[0].GetChildMemberWithName("esp")
address = espValue.GetValueAsUnsigned() + target.addr_size
return espValue.CreateValueFromAddress('arg0', address, target.FindFirstType('id'))
@sumchattering
sumchattering / gist:7318682
Last active December 27, 2015 11:29
AFRocketClient.podspec
Pod::Spec.new do |s|
s.name = 'AFRocketClient'
s.version = '1.0'
s.license = 'MIT'
s.summary = 'AFNetworking Client for Server sent events'
s.homepage = 'https://github.com/derrh/AFRocketClient'
s.author = { 'Mattt Thompson' => 'm@mattt.me' }
s.source = { :git => 'https://github.com/ebuddy/AFRocketClient' }
s.source_files = 'AFRocketClient/*.{h,m}'
s.requires_arc = true
@sumchattering
sumchattering / coredata.m
Last active October 6, 2015 12:28
Core Data Backgrounding
#import "HiveDeviceCoreDataManager.h"
static HiveDeviceCoreDataManager* globalManager = nil;
NSString *const HiveDeviceCoreDataRefetchAllDatabaseData = @"DeviceRefetchAllDatabaseData";
@implementation HiveDeviceCoreDataManager
@synthesize mainContext = _mainContext;
@synthesize managedObjectModel = _managedObjectModel;
@sumchattering
sumchattering / wordchain.py
Created March 2, 2012 06:02
Python Word Chainer
# !/usr/bin/env python
# encoding: utf-8
# Written by Sumeru Chatterjee
import sys
import pdb
import os
import pprint
characters = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
@sumchattering
sumchattering / appledocgen.sh
Created July 12, 2011 09:20
Script to be used within xcode as a build phase to generate documentation with appledoc
#!/bin/sh
# Script to be used within xcode to generate documentation through appledoc
# Prior to the execution of this script the appledoc executable and templates should have been copied
# to the appledoc folder in the project root directory
#
# Created by Sumeru Chatterjee when he was awake till 7 AM on July 12 2011
# https://gist.github.com/1077672
#Company Name the only variable that I cant seem to grab from the environment_variables
COMPANY=My_Company_Name