Skip to content

Instantly share code, notes, and snippets.


Nitin Nain nitinnain

View GitHub Profile
nitinnain / mbp-setup.markdown
Created Aug 1, 2017 — forked from jasonrhodes/mbp-setup.markdown
Setting up my new MacBook Pro
View mbp-setup.markdown
  • Set up user account
  • Name computer
  • Check trackpad settings
  • Install Google Chrome
  • Install Homebrew
  • Brew should auto-install Xcode Developer Tools for you
  • $ brew doctor
  • $ brew install git
  • Download node.js (I prefer the installer over brew)
  • npm is now installed, too
nitinnain / FCPrivateBatteryStatus.m
Created Jul 15, 2017 — forked from marcoarment/FCPrivateBatteryStatus.m
How to get raw battery info (mAh remaining, etc.) from iOS using private APIs. For internal testing only, NOT APP STORE DISTRIBUTION!
View FCPrivateBatteryStatus.m
#import <Foundation/Foundation.h>
#include <dlfcn.h>
NSDictionary *FCPrivateBatteryStatus()
static mach_port_t *s_kIOMasterPortDefault;
static kern_return_t (*s_IORegistryEntryCreateCFProperties)(mach_port_t entry, CFMutableDictionaryRef *properties, CFAllocatorRef allocator, UInt32 options);
static mach_port_t (*s_IOServiceGetMatchingService)(mach_port_t masterPort, CFDictionaryRef matching CF_RELEASES_ARGUMENT);
static CFMutableDictionaryRef (*s_IOServiceMatching)(const char *name);
nitinnain /
Created Jan 16, 2017 — forked from iros/
Documenting your REST API


<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

View geocode-user-input-address.html
<div class="row">
<div class="col-md-2 col-sm-2 col-xs-2">
<p><button class="btn btn-primary btn-sm" id="map-address-btn"><span>Find It</span></button></p>
</div><!-- .col -->
<div class="col-md-10 col-sm-10 col-xs-10">
<div class="panel panel-default">
<div class="panel-heading">Location Response</div>
<div class="panel-body">
<p>Enter Address: <input id="location-address" type="text" class="form-control" placeholder="Street, City, State"/</p>
<p>Map:</p><div id="map-canvas" style="height: 400px;"></div>

Most active GitHub users (

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at from Sun, 02 Dec 2012 10:24:58 GMT till Mon, 02 Dec 2013 10:24:58 GMT.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

  .filter((user) -> user.followers > 221)
from geventwebsocket.handler import WebSocketHandler
from gevent.pywsgi import WSGIServer
from flask import Flask, request, render_template
app = Flask(__name__)
def index():
return render_template('index.html')
View Evolution of a Python
#Newbie programmer
def factorial(x):
if x == 0:
return 1
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal