Skip to content

Instantly share code, notes, and snippets.

View chirag04's full-sized avatar
🚢

Chirag Jain chirag04

🚢
View GitHub Profile
@chirag04
chirag04 / benchmark.txt
Created October 14, 2012 13:53
Benchmarking node.js app
chirag@chirag-VPCEH24FX:~$ ab -r -n 100000 -c 1000 localhost:3000/stock/tcs
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
@chirag04
chirag04 / gist:3919767
Created October 19, 2012 18:17
Benchmarking node.js app v0.0.1
chirag@chirag-VPCEH24FX:/etc/haproxy$ ab -r -n 100000 -c 1000 localhost:3005/stock/tcs
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
@chirag04
chirag04 / gist:7025400
Created October 17, 2013 13:59
Setup postgresql on ubuntu
http://blog.revathskumar.com/2013/10/setup-postgresql-on-ubuntu.html
@chirag04
chirag04 / nginx
Created November 21, 2013 09:53
nginx
location ~/profile_picture(^.+\.(jpg|jpeg|gif|png)$) {
alias /home/chirag/Desktop/xyz/profile_pictures/$1;
expires -1;
}
location ~*(^.+\.(jpg|jpeg|gif|css|png|js|ico|eot|otf|svg|ttf|woff|hbs)$) {
alias /home/chirag/Desktop/xyz/static/$1;
expires -1;
}
@chirag04
chirag04 / express-busboy.js
Created December 12, 2013 14:43
express-busboy.js
var BusBoy = require('busboy'),
fs = require('fs'),
path = require('path');
var RE_MIME = /^(?:multipart\/.+)|(?:application\/x-www-form-urlencoded)$/i;
// options will have limit and uploadDir.
exports = module.exports = function(options){
return function multipart(req, res, next) {
@chirag04
chirag04 / gist:9553473
Created March 14, 2014 18:11
bootstrap navbar trick
$(window).scroll(function() {
if ($(document).scrollTop() < 60) {
$("#navigation").removeClass("navbar-open").addClass("navbar-close");
}
else {
$("#navigation-top").removeClass("navbar-close").addClass("navbar-open");
}
});
@chirag04
chirag04 / algo repo
Last active December 17, 2017 03:45
algo repo
http://www.cs.sunysb.edu/~algorith/
@chirag04
chirag04 / gist:f16d22b2fae3188dd931
Created April 28, 2015 18:17
react-native 0.4.1 changelog
#import "RCTTextField.h"
@interface RCTTextField (ToolTipMenu)
- (void)tappedMenuItem:(NSString *)text;
@end
var WithLabel = React.createClass({
responder: PanResponder.create({
onStartShouldSetResponderCapture: (evt) => true,
onStartShouldSetPanResponder: (evt) => true,
onMoveShouldSetPanResponder: (evt) => true,
onPanResponderGrant: this.handlePress,
onPanResponderMove: this.handlePress,
onPanResponderRelease: this.handlePress,
onPanResponderTerminate: this.handlePress,
}),