Skip to content

Instantly share code, notes, and snippets.

View nathankleyn's full-sized avatar
👨‍💻
Creating!

Nathan Kleyn nathankleyn

👨‍💻
Creating!
View GitHub Profile
@nathankleyn
nathankleyn / keybase.md
Created April 7, 2014 10:03
My Keybase Proof For GitHub

Keybase proof

I hereby claim:

  • I am nathankleyn on github.
  • I am nathankleyn (https://keybase.io/nathankleyn) on keybase.
  • I have a public key whose fingerprint is EB7C A542 5921 6E8A B45A 281D CB15 F387 A456 9943

To claim this, I am signing this object:

@nathankleyn
nathankleyn / generators.js
Last active August 29, 2015 14:13
An example of JavaScript generators.
function *asyncThing1() {
someAsyncFn(function(val) {
yield val;
});
}
function *asyncThing2(arg) {
someOtherAsyncFn(arg, function(val) {
yield val;
});
@nathankleyn
nathankleyn / gradle_plugin.rb
Created June 3, 2015 06:41
Gradle Shanty Plugin
require 'english'
require 'shanty/plugin'
module Shanty
# Public: Gradle plugin for building and testing Gradle projects.
module GradleMultiProjectPlugin
extend Plugin
INCLUDE_REGEX = /include\s+((?:(?:,[\s\n\\]+)?['"][^'"]+["'])+)/
var subcats = cats[foo_barcat_id].subcats;
var subcatHash = $.extend({}, subcats);
$('tr[id^=all_fields_]').each(function() {
if($(this).id == 'all_fields_' + foo_barcat_id) {
$(this).hide();
} else {
$(this).show();
}
});
@nathankleyn
nathankleyn / .bashrc
Created January 13, 2011 15:09
A .bashrc for Ubuntu 10.10 with RVM system wide changes already made. Note that this has a couple of extra aliases.
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
if [[ -n "$PS1" ]]; then
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@nathankleyn
nathankleyn / zeromq-install.sh
Created February 26, 2011 11:55
Install 0MQ lib, ruby bindings, and python bindings, and start the 0MQ daemon.
#!/usr/bin/env bash
if [ ! -e ./.zmq ]; then
# Move into temporary directory.
mkdir .zmq
cd .zmq
# Add repository for 0MQ.
sudo add-apt-repository ppa:chris-lea/zeromq
@nathankleyn
nathankleyn / css_to_scss.sh
Created April 27, 2011 12:25
Rename CSS extension files to SCSS
#!/bin/sh
for file in **/pepsi.css ; do git mv $file `echo $file | sed 's/\(.*\.\)css/\1scss/'` ; done
@nathankleyn
nathankleyn / helloworld.sh
Created August 27, 2011 18:09
Test bash script for Bashy
vm update
echo "Done."
@nathankleyn
nathankleyn / js_hint_output.txt
Created September 5, 2011 14:39
JSHint Output
nathan@orchid:~/Code/global_dawn/platform-seagull/www/js$ jshint app/**/*.js gd/**/*.js
app/base.js: line 59, col 30, 'app' is not defined.
app/base.js: line 60, col 34, 'app' is not defined.
app/base.js: line 61, col 34, 'app' is not defined.
app/base.js: line 62, col 38, 'app' is not defined.
app/base.js: line 63, col 38, 'app' is not defined.
app/base.js: line 63, col 79, Extra comma.
app/controllers/Home.js: line 96, col 17, 'dojox' is not defined.
app/controllers/Home.js: line 109, col 17, 'dojox' is not defined.
gd/core/Dispatcher.js: line 44, col 13, Too many var statements.
@nathankleyn
nathankleyn / kernel_cleanup.sh
Created December 6, 2011 13:56
Cleanup Ubuntu Kernels
dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | xargs sudo apt-get -y purge