Skip to content

Instantly share code, notes, and snippets.

View chirag04's full-sized avatar
🚢

Chirag Jain chirag04

🚢
View GitHub Profile
@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 / gist:f16d22b2fae3188dd931
Created April 28, 2015 18:17
react-native 0.4.1 changelog
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,
}),
@chirag04
chirag04 / RCTText.h
Created May 15, 2015 21:27
Core changes for tooltip with text idea
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <UIKit/UIKit.h>
- (void)request:(SKRequest *)request didFailWithError:(NSError *)error {
NSLog(@"Failed to load list of products.%@", error);
}
@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
ide: 72
brentvatne: 20
PhilippKrone: 18
cancan101: 14
yelled3: 13
mkonicek: 11
aleclarson: 10
jaygarcia: 9
satya164: 8
rocman: 8
@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;
}