Skip to content

Instantly share code, notes, and snippets.

View furqanZafar's full-sized avatar

Furqan Zafar furqanZafar

View GitHub Profile
function ProbCriticalNormal(P)
{
// input p is confidence level convert it to
// cumulative probability before computing critical
var Y, Pr, Real1, Real2, HOLD;
var I;
var PN = [0, // ARRAY[1..5] OF REAL
-0.322232431088 ,
@furqanZafar
furqanZafar / kill long running mongo ops
Last active August 29, 2015 14:10
Kill long running mongo ops
ops = db.currentOp().inprog.map(function(e){
return [e.opid, e.secs_running]
});
ops.filter(function(e){
return e[1] > 200;
}).map(function(e){
db.killOp(e[0])
});
@furqanZafar
furqanZafar / delete-all-git-tags
Last active August 29, 2015 14:10
Delete all git tags
for t in `git tag`
do
git push origin :$t
git tag -d $t
done
We couldn’t find that file to show.
@furqanZafar
furqanZafar / Google Play LP 2
Last active August 29, 2015 14:06
Google Play LP API
# Google Play LP API
This API is going to be used by our Android apps. The purpose is to increase subscriptions from Google Play.
## API
Verbs:
- visitId
- isSubscriber
@furqanZafar
furqanZafar / Google Play LP API
Created September 9, 2014 10:02
Google Play LP API
# Google Play LP API
This API is going to be used by our Android apps. The purpose is to increase subscriptions from Google Play
## API
Verbs:
- signup
- getVisitId
@furqanZafar
furqanZafar / Four Terminals
Created September 8, 2014 14:28
Spawn 4 Terminals
tell application "System Events"
set width to 840
set height to 495
set y to 525
tell application "Terminal"
do script ""
do script ""
do script ""
do script ""
end tell
echo "/uae" | sed 's/.*/http\:\/\/wap\.mozook\.com&/' | xargs -I{} curl -H"user-agent:android" {} -I
@furqanZafar
furqanZafar / 0_reuse_code.js
Created January 27, 2014 10:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@furqanZafar
furqanZafar / expressSSL
Created December 24, 2013 07:03
Create SSL server using express (nodejs)
### GENERATE PRIVATE KEY (key.pem)
# openssl req -newkey rsa:2048 -new -nodes -keyout key.pem -out csr.pem
### GENERATE CERTIFICATE (cert.pem)
# openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem
express = require("express")
fs = require('fs')
https = require('https')