Skip to content

Instantly share code, notes, and snippets.

View byeval's full-sized avatar
🏊‍♂️

byeval byeval

🏊‍♂️
View GitHub Profile
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@byeval
byeval / iterm2.md
Created February 10, 2017 08:00
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
Previous Tab + Left Arrow
Next Tab + Right Arrow
Go to Tab + Number
Go to Window + Option + Number
Go to Split Pane by Direction + Option + Arrow
Go to Split Pane by Order of Use + ] , + [
@byeval
byeval / class_decorator.ts
Created August 9, 2016 16:43 — forked from remojansen/class_decorator.ts
TypeScript Decorators Examples
function logClass(target: any) {
// save a reference to the original constructor
var original = target;
// a utility function to generate instances of a class
function construct(constructor, args) {
var c : any = function () {
return constructor.apply(this, args);
}
@byeval
byeval / .eslintrc
Created December 6, 2015 13:47 — forked from ghostwords/.eslintrc
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"arrowFunctions": false, // enable arrow functions
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"classes": false, // enable classes
"defaultParams": false, // enable default function parameters
"destructuring": false, // enable destructuring
@byeval
byeval / slim-redux.js
Created December 6, 2015 07:58 — forked from gaearon/slim-redux.js
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
@byeval
byeval / todo.markdown
Last active December 4, 2015 00:09
todo

some todo

  • tweet to do
  • comment to do
  • tweet vote

another todo list

  • todo
  • done
@byeval
byeval / README.md
Created October 21, 2015 09:08 — forked from hwdsl2/.MOVED.md
IPsec L2TP VPN Auto Install Script for Ubuntu 14.04 & 12.04 and Debian 8
@byeval
byeval / bloop.js
Last active August 29, 2015 14:22 — forked from jlongster/bloop.js
(function() {
// Do not use this library. This is just a fun example to prove a
// point.
var Bloop = window.Bloop = {};
var mountId = 0;
function newMountId() {
return mountId++;
}
@byeval
byeval / gist:e524af22651bc9d0d250
Created April 19, 2015 16:19
canvas points based smoothline
canvas.addEventListener('mousedown', function(e) {
saveDrawingSurface()
painting = true
points.push({
x: e.offsetX,
y: e.offsetY,
t: e.timeStamp
})
ctx.moveTo(e.offsetX, e.offsetY)
})
@byeval
byeval / keyCode for Game
Created September 15, 2014 02:05
keyCode for Game
var keys = [];
window.addEventListener('keyDown', keyPressed, false);
window.addEventListener('keyUp', keyReleased, false);
function keyPressed(e){
keys[e.keyCode] = true;
if(keys[17] && keys[16]){
//dosomething;