Skip to content

Instantly share code, notes, and snippets.

View nilz3ro's full-sized avatar
🧃

nil nilz3ro

🧃
View GitHub Profile
@nilz3ro
nilz3ro / flatten.js
Last active December 1, 2015 18:38
es6 recursion
'use strict';
const flatten = (...args) => {
let [head, ...tail] = args;
return head === undefined
? []
: ( Array.isArray(head) ? [...flatten(...head), ...flatten(...tail)] : [head, ...flatten(...tail)] )
;
}
@nilz3ro
nilz3ro / bouncyCastle.js
Last active December 14, 2015 16:36
npm-scripts compatible way to exit if you are not using the supported node version for your project.
(function() {
var message = '';
var exitCode = 0;
var supportedNodeVersion = 'v0.10.36';
if(process.version === supportedNodeVersion) {
message = 'You are using the supported node version for this project, Continuing.';
}
else {
message = 'You must use node v0.10.36 while developing this project. Exiting.';
@nilz3ro
nilz3ro / max-integer-by-bit.go
Created December 21, 2015 07:15
Wondering what the maximum integer value is in the go language? Wonder no more!!!
package main
import "fmt"
const (
MaxInt8 = 1<<7 - 1 // 127
MinInt8 = -1 << 7
MaxInt16 = 1<<15 - 1 // 32_767
MinInt16 = -1 << 15
MaxInt32 = 1<<31 - 1 // 2_147_483_647
MinInt32 = -1 << 31
# Path to your oh-my-zsh installation.
export ZSH=/Users/abuddington/.oh-my-zsh
source /usr/local/share/chruby/chruby.sh
source /usr/local/opt/chruby/share/chruby/auto.sh
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh
alias be="bundle exec"
alias gs="git status"
set -g default-terminal "screen-256color"
set -g status-bg white
set -g status-fg black
set -g pane-border-style fg=black
set -g pane-active-border-style fg=white
set -g pane-active-border-style bg=black
# remap prefix to Control + a
set -g prefix C-a
# bind 'C-a C-a' to type 'C-a'
@nilz3ro
nilz3ro / ws.md
Last active February 27, 2016 04:36
WebSocket Notes

Notes

WebSocket Protocol is an Application Layer protocol that enables a client and server to send and receive messages simultaneously through a full duplex stream over one TCP/IP connection on port 80 or 443.

Default WebSocket protocol client request, and server response:

  • send HTTP/1.1 GET
    GET /chat HTTP/1.1
    
    Host: server.example.com
    
@nilz3ro
nilz3ro / lambda.js
Created July 14, 2016 02:01
lambda expressions / currying in es6
((n) => ((y) => y*n))
// [Function]
((n) => ((y) => y*n))(9)
// [Function]
((n) => ((y) => y*n))(9)(3)
// 27
@nilz3ro
nilz3ro / .tmux.conf
Created August 31, 2016 17:48
Tmux Conf
set -g default-terminal "screen-256color"
set -s escape-time 0
set -g prefix C-a
bind C-a send-prefix
unbind C-b
set -g mouse on
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
@nilz3ro
nilz3ro / brew.txt
Last active September 21, 2016 02:09
ack
autoconf
automake
aws-elasticbeanstalk
awscli
bdw-gc
boot-clj
cairo
chgems
chrome-cli
@nilz3ro
nilz3ro / agile.md
Created October 10, 2016 16:56
Agile / Scrum As presented as Roger H.

Agile (As presented by Roger H.)

We should always be delivering The Thing that has the most Business Value.

Terms

Agile

The ability to create and respond to change in order to succeed in an uncertain and turbulent environment.

Scrum