touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/wayneseymour/tk.git
git push -u origin master
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
cat input_file | sed 's/^..//' > output_file |
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
// This object generates strictly increasing serial numbers | |
var serialnum = { | |
// This data property holds the next serial number. | |
// The $ in the property name hints that it is a private property. | |
$n: 0, | |
// Return the current value and increment it | |
get next() { | |
return this.$n++; | |
}, | |
// Set a new value of n, but only if it is larger than current |
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
// This function works with or without 'new': a constructor and factory function | |
function Range(from,to) { | |
// These are descriptors for the read-only from and to properties. | |
var props = { | |
from: {value:from, enumerable:true, writable:false, configurable:false}, | |
to: {value:to, enumerable:true, writable:false, configurable:false} | |
}; | |
if (this instanceof Range) // If invoked as a constructor | |
Object.defineProperties(this, props); // Define the properties | |
else // Otherwise, as a factory |
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
set nocompatible " be iMproved | |
filetype off " required! | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
" let Vundle manage Vundle | |
" required! | |
Bundle 'gmarik/vundle' | |
" |
-
Download [jshint.vim][jshint]
-
Put it in
~/.vim/plugin/jshint.vim
-
Edit your local vimrc file (I'm on macvim with janus, so it's at
~/.gvimrc.local
) and add:au BufWritePost *.js :JSHint
-
Read the [vim docs][vim] and particularly [auto commands][auto] I'm a newb and the neckbeards are probably laughing at me for even posting this.
-
Download [jshint.vim][jshint]
-
Put it in
~/.vim/plugin/jshint.vim
-
Edit your local vimrc file (I'm on macvim with janus, so it's at
~/.gvimrc.local
) and add:au BufWritePost *.js :JSHint
-
Read the [vim docs][vim] and particularly [auto commands][auto] I'm a newb and the neckbeards are probably laughing at me for even posting this.
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
// example using the raf module from npm. try changing some values! | |
var requestAnimationFrame = require("raf") | |
var canvas = document.createElement("canvas") | |
canvas.width = 500 | |
canvas.height = 500 | |
document.body.appendChild(canvas) | |
var context = canvas.getContext("2d") |
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
#!/bin/bash | |
# Recursively add line feed to .js files that need it | |
# Usage: $ ./fix-line-endings.sh DIRECTORY_TO_RECURSE | |
function traverse() { | |
for file in $(ls "$1") | |
do | |
#current=${1}{$file} |