Skip to content

Instantly share code, notes, and snippets.

Gus Knowlden gus

Block or report user

Report or block gus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View life.kt
/**
* This is a straightforward implementation of The Game of Life
* See http://en.wikipedia.org/wiki/Conway's_Game_of_Life
*/
package life
/*
* A field where cells live. Effectively immutable
*/
class Field(
View to-gabriel.asc
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1
hQIMA5qBTfxp70ruARAAlw6neEZ62CHefe6NhllFcGZ98I6vCOAkbtXTdOmocM4y
KfhocqhNjL9rWf35TEq1iP1kwXvz9mnAoWd8ZMftIOYf+2Hg7hbuxl+9MgUknxz7
NkPwF4hIvebqIjylDQTvO8/ry+rAzmdYQWgNsnxomAUVOAzYBuDr8xfGkOvYRvdI
wAtGSViQ4eeZHLDZ0IGH2ptzHt/Wr5/6teDOBmb6D8yyS4MEJP0o/qhAvDXUWEMH
jCRyb/s3hXo0eXvG3Zczkvd2yrjqyo0t8sqi/lOV6yHarT5btzHpPMczyD/q6Leb
7ecaumtwlIY5Ysyirri2vJ1YRfMkhZNqvpM7aO6ANnW6WaP1xD3YlX+PQm0cAtYp
vKEr1E8IjmGxfHhx3tv2AAsvHL4kUFmQ7vCxRGXTKwN8M8OZGJ4rnfMt/wA+gHy+
View keybase.md

Keybase proof

I hereby claim:

  • I am gus on github.
  • I am gus (https://keybase.io/gus) on keybase.
  • I have a public key ASCO7dFjqx8AwoU757Ewi4-g7bsEKsfqhSIFNUpMcCaYgAo

To claim this, I am signing this object:

@gus
gus / external-with-docwrite.js
Created Mar 20, 2012
document.write weirdness
View external-with-docwrite.js
console.log("external1 before/" + document.readyState);
document.write("hello again, world");
console.log("external1 after/" + document.readyState);
View results.md

Your Top Character Strength

Forgiveness and mercy

You forgive those who have done you wrong. You always give people a second chance. Your guiding principle is mercy and not revenge.

Your Second Character Strength

Humor and playfulness

@gus
gus / node-express-cart.js
Created Oct 27, 2010
Shopping cart express+node middleware
View node-express-cart.js
var Cart = function(storedItems) {
var items = storedItems || {};
this.add = function(item, sku) {
var storedItem = items[sku];
if (storedItem == undefined) {
storedItem = items[sku] = {quantity: 0, item: item}
}
storedItem.quantity += 1;
};
View a-bundler-whoa.markdown

I'm not sure what the feature is called in 0.9.26, so I'll describe it instead; essentially, I can package (vendor/cache) my gems for use in deployment and if during the deployment (bundle install vendor/bundle) a gem is found in the shared gems repo (managed through RVM gemsets per project) then that gem is used without unpacking it in vendor/bundle. This is useful to me because my ops dude pre-installs gems needing compilation on all of the systems needing it (managed through Puppet for now); these gems are currently unicorn and bson_ext.

You can argue that he just shouldn't do that and I won't argue back, but that's something he likes since he doesn't want to have to recompile unicorn, bson_ext, etc. for each system as deploys are running; we have a few systems to manage and the list is growing; we also have several services working together and not all are ruby, so he just wants simple deploys. I also can't argue too much with that as there are oodles of things he concerns himself with that I don't have/

View gc_stats.rb
# From mattetti's gc_stats.rb
# Basic middleware to help developers track their memory usage
# DO NOT USE IN PRODUCTION
# Currently only tested on Ruby 1.9 and no support guaranteed
# Output example:
#
# GC run, previous cycle was 255 requests ago.
#
@gus
gus / 1_preamble.md
Created Jul 28, 2010
Hellooooo, Ben
View 1_preamble.md

This is example is taken from a live app I'm playing around with. It's been retrofitted and trimmed for example usage for one Mr. Ben Guthrie! Custom gists by demand. Get em' while they're hot!

@gus
gus / riot_example.rb
Created Jul 20, 2010 — forked from toothrot/riot_example.rb
Riot examples - via toothrot
View riot_example.rb
require 'rubygems'
require 'riot'
context "Something" do
setup do
D = 8
end
asserts("big") { 8==D }
asserts("bigger") { 8===D }
You can’t perform that action at this time.