Skip to content

Instantly share code, notes, and snippets.

View naveen's full-sized avatar

naveen naveen

View GitHub Profile
@naveen
naveen / keybase.md
Created March 24, 2014 20:53
keybase.md

Keybase proof

I hereby claim:

  • I am naveen on github.
  • I am naveen (https://keybase.io/naveen) on keybase.
  • I have a public key whose fingerprint is DEB2 4190 A5A4 5E4C 61B0 9C7E DCEB 3B72 958C DB81

To claim this, I am signing this object:

@naveen
naveen / everyplacemap.html
Created February 8, 2014 22:47
every place i've been map.
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>every place i've been.</title>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<script src='http://api.tiles.mapbox.com/mapbox.js/v1.5.2/mapbox.js'></script>
<link href='http://api.tiles.mapbox.com/mapbox.js/v1.5.2/mapbox.css' rel='stylesheet' />
@naveen
naveen / group-genstrings.sh
Created December 4, 2013 16:04
To genstrings, grouped by filename (Using https://github.com/samwize/localized)
python -c "import urllib2; exec urllib2.urlopen('https://raw.github.com/samwize/localized/master/genstrings.py').read()" > Localizable.strings
@naveen
naveen / genstrings-r.sh
Created December 3, 2013 20:55
recurse *.m for strings
find . -name \*.m | xargs genstrings
@naveen
naveen / an-nginx-https-config
Last active December 18, 2015 09:18
nginx http+https (www.* and api.*)
Generate Certificates
To generate private (dummy) certificates you can perform the following list of openssl commands.
First change directory to where you want to create the certificate and private key, for example:
$ cd /usr/local/nginx/conf
Now create the server private key:
$ openssl genrsa -out server.key 2048
You can also create a private key with a passphrase, but you will need to enter it every time you start nginx:
@naveen
naveen / linode-debian-initial
Created June 10, 2013 23:47
getting up and going on linode with debian 6
ssh root@_
echo "kitsune" > /etc/hostname
hostname -F /etc/hostname
to /etc/hosts:
12.34.56.78 plato.example.com plato
2600:3c01::a123:b456:c789:d012 plato.example.com plato
dpkg-reconfigure tzdata
@naveen
naveen / afconvert-wav-caf.sh
Created May 23, 2013 16:41
convert a wav into a caf suitable for ios push.
afconvert ~/Desktop/reminder.wav ~/Desktop/reminder.caf -d ima4 -f caff -v
@naveen
naveen / UIWebView-intercept.m
Last active December 16, 2015 15:19
intercept custom JS handlers and inject custom HTTP headers in a UIWebView
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
BOOL headersArePresent = [[request allHTTPHeaderFields] objectForKey:@"X-Custom-Timezone"] != nil;
if (!headersArePresent) {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
dispatch_async(dispatch_get_main_queue(), ^{
NSURL *url = [request URL];
if ([[url scheme] isEqualToString:@"customjs"]) {
// parse the rest of the URL object and execute functions