Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
?????????????????????????????????????????????????

####################################################### bingeboy

💭
?????????????????????????????????????????????????
View GitHub Profile
@bingeboy
bingeboy / blog
Created Feb 9, 2014
MongoDB Week 4
View blog
> db.posts.getIndexes()
[
{
"v" : 1,
"key" : {
"_id" : 1
},
"ns" : "blog.posts",
"name" : "_id_"
},
@bingeboy
bingeboy / gist:8970478
Created Feb 13, 2014
backtotop tablet
View gist:8970478
document.addEventListener("touchmove", ScrollStart, false);
document.addEventListener("scroll", Scroll, false);
document.addEventListener("touchcancel", Scroll, false);
function ScrollStart() {
//hide back to top button now if it exists
}
function Scroll() {
//show back to top button now if scroll far enough
@bingeboy
bingeboy / .tmux.conf
Last active Aug 29, 2015
tmux commands
View .tmux.conf
# remap C-b to C-a
set -g prefix C-a
unbind C-b
bind C-a send-prefix
#set index to 1
set -g base-index 1
set -g base-pane-index 1
#split window horizontal
View test from mongofb class
# Make the following directories so the relp set can log each db
mongod --replSet m101 --logpath "1.log" --dbpath /Users/bingeboy/Dropbox/mongodbClass/nodeClassAttempt2/hw6/hw6-5/data/shard0/rs1 --port 27017 --smallfiles --oplogSize 64 --fork
mongod --replSet m101 --logpath "2.log" --dbpath /Users/bingeboy/Dropbox/mongodbClass/nodeClassAttempt2/hw6/hw6-5/data/shard0/rs2 --port 27018 --smallfiles --oplogSize 64 --fork
mongod --replSet m101 --logpath "3.log" --dbpath /Users/bingeboy/Dropbox/mongodbClass/nodeClassAttempt2/hw6/hw6-5/data/shard0/rs3 --port 27019 --smallfiles --oplogSize 64 --fork
#make a config folder at the save level as the data folder
#make 3 config files, one for each server.
config = { _id: "m101", members:[ { _id : 0, host : "localhost:27017"}, { _id : 1, host : "localhost:27018"}, { _id : 2, host : "localhost:27019"} ] };
View Curry Prototype
var currier = function(fn) {
var args = Array.prototype.slice.call(arguments, 1)
return function() {
return fn.apply(this, args.concat(Array.prototype.slice.call(arguments, 0)))
}
}
View editor.js
var fs = require('fs');
var child_process = require('child_process');
var spawn = child_process.spawn;
function openEditor(file) {
var cp = spawn(process.env.EDITOR, [file], {
customFds: [
process.stdin,
process.stdout,
process.stderr
@bingeboy
bingeboy / 0_reuse_code.js
Created Mar 7, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@bingeboy
bingeboy / nodeInstallMake
Created Mar 28, 2014
How to install nodejs on ARM chipset
View nodeInstallMake
$ cd /opt/node
#if don't have that dir created yet
$ mkdir -p /opt/node
$ wget http://nodejs.org/dist/v0.10.26/node-v0.10.26.tar.gz
$ tar -xvf node-v0.10.26.tar.gz
$ cd node-v0.10.26
$ ./configure
$ sudo make
# note above make takes forever to build
$ sudo make install
@bingeboy
bingeboy / testResults.md
Last active Aug 29, 2015
Express vs Restify Apache Benchmark Results
View testResults.md

#Express vs Restify Apache Benchmark Results

###Test

$ ab -n 10000 -c 100 http://localhost:3000/

###Versions Details node v0.10.26

@bingeboy
bingeboy / abtest
Created Apr 8, 2014
Apache AB benchmark test
View abtest
#if you are on osx and use brew tap formula needed.
$ ab -n 10000 -c 100 http://yahoo.com/
# this will make 10,000 requests with 100 concurrent connections.