Skip to content

Instantly share code, notes, and snippets.

@nitinnain
nitinnain / README.md
Created January 16, 2019 17:50 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet
@nitinnain
nitinnain / mbp-setup.markdown
Created August 1, 2017 08:53 — forked from jasonrhodes/mbp-setup.markdown
Setting up my new MacBook Pro
  • Set up user account
  • Name computer
  • Check trackpad settings
  • Install Google Chrome
  • Install Homebrew http://brew.sh/
  • Brew should auto-install Xcode Developer Tools for you
  • $ brew doctor
  • $ brew install git
  • Download node.js (I prefer the installer over brew) http://nodejs.org/download/
  • npm is now installed, too
@nitinnain
nitinnain / FCPrivateBatteryStatus.m
Created July 15, 2017 13:18
How to get raw battery info (mAh remaining, etc.) from iOS using private APIs. For internal testing only, NOT APP STORE DISTRIBUTION!
#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
nitinnain / API.md
Created January 16, 2017 06:15 — forked from iros/API.md
Documenting your REST API

Title

<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:

<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 (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com 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:

githubUsers
 .filter((user) -&gt; user.followers &gt; 221)
from geventwebsocket.handler import WebSocketHandler
from gevent.pywsgi import WSGIServer
from flask import Flask, request, render_template
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal