Skip to content

Instantly share code, notes, and snippets.

View duskhacker's full-sized avatar

Daniel P. Zepeda duskhacker

  • San Antonio, Texas
View GitHub Profile

Keybase proof

I hereby claim:

  • I am duskhacker on github.
  • I am duskhacker (https://keybase.io/duskhacker) on keybase.
  • I have a public key ASAKt3axxCPqVEzgrHnHM9mG3db1Tsqd3Osv-0UIuaiI7wo

To claim this, I am signing this object:

// Daniel Z.'s solution
// Part 1.
// Implement a function prototype extension that caches function results for
// the same input arguments of a function with one parameter.
//
// For example:
// Make sin(1) have the result of Math.sin(1), but use a cached value
// for future calls.
//
// Part 2.
MyStuff = function(container) {
var index;
function log(){
console.log(index);
}
function iterate(){
log();
if(index>1) setTimeout(iterate, 1000);
#!/usr/bin/env ruby
require 'rubygems'
require 'activerecord'
File.unlink('biology_data.db') rescue nil
File.unlink('life_form_data.db') rescue nil
ActiveRecord::Base.establish_connection(
:adapter => "sqlite3",
:dbfile => "biology_data.db"
#!/usr/bin/env ruby
require 'rubygems'
require 'activerecord'
require 'spec'
class DiskFreeSpace < ActiveRecord::Base; end
class DiskFreeSpaceRunner
def initialize(environment = 'production')