This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import the external modules | |
_ = require('lodash')._ | |
extend = require('extend') | |
colors = require('colors') | |
config = require('./config') | |
# # Basic Module | |
# ### extends [EventEmitter] | |
# Basic module to handle errors and initialize modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hashFnv32a = (str) -> | |
#jshint bitwise:false | |
hval = 0x811c9dc5 | |
i = 0 | |
l = str.length | |
while i < l | |
hval ^= str.charCodeAt(i) | |
hval += (hval << 1) + (hval << 4) + (hval << 7) + (hval << 8) + (hval << 24) | |
i++ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install a new Mac | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# install services | |
brew install node memcached redis mysql caskroom/cask/brew-cask | |
# install tools | |
brew cask install sitesucker bettertouchtool dropbox synology-assistant synology-photo-station-uploade vagrant vagrant-manager virtualbox | |
# install general apps | |
brew cask install google-chrome firefox libreoffice macdown skype audacity teamviewer inkscape | |
# install dev apps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If not running interactively, don't do anything | |
[ -z "$PS1" ] && return | |
function list-ps(){ | |
ps -A | grep $1 | awk '{ if ($4 != "grep"){a = ( $1 " " a ) }}END{print a}' | |
} | |
function kill-ps(){ | |
ps -A | grep $1 | awk '{ if ($4 != "grep"){a = ( $1 " " a ) }}END{print a}' | xargs kill -9 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
INSTALL: | |
Init Testcase by using the module rsmq-cli: | |
$ rsmq -n wildcard create -q wildlife | |
$ rsmq -n wildcard create -q wildpark | |
$ rsmq -n wildcard create -q wildcard | |
$ rsmq -n wildcard create -q wilderness | |
$ rsmq -n wildcard create -q safari |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hashFnv32a = (str, asString, seed) -> | |
#jshint bitwise:false | |
i = undefined | |
l = undefined | |
hval = (if (seed is `undefined`) then 0x811c9dc5 else seed) | |
i = 0 | |
l = str.length | |
while i < l | |
hval ^= str.charCodeAt(i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
txt = [] | |
$( ".list" ).each ( idx, tbl )-> | |
txt.push "\n## " + $(tbl).find( "h2" ).text() + "\n" | |
$(tbl).find( ".js-card-name" ).each (idx, card)-> | |
txt.push "- " + card.lastChild.data | |
txt.join( "\n" ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root = @ | |
MYMODULE = | |
foo: 42 | |
fizzy: -> | |
return "bubbele" | |
# Export the module | |
if typeof module isnt 'undefined' and module.exports | |
exports = module.exports = MYMODULE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Install: "npm i prompt" | |
// Usage: "node dh.js" | |
var crypto, dh, prompt; | |
crypto = require('crypto'); | |
prompt = require('prompt'); | |
dh = crypto.getDiffieHellman('modp5'); | |
dh.generateKeys(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nsqlookupd -http-address=127.0.0.1:4161 -tcp-address=127.0.0.1:4160 & | |
nsqlookupd -http-address=127.0.0.1:4163 -tcp-address=127.0.0.1:4162 & | |
nsqd -lookupd-tcp-address=127.0.0.1:4160 -lookupd-tcp-address=127.0.0.1:4162 & | |
nsqadmin -lookupd-http-address=127.0.0.1:4161 -lookupd-http-address=127.0.0.1:4163 & |
OlderNewer