Skip to content

Instantly share code, notes, and snippets.

View jrunning's full-sized avatar

Jordan Running jrunning

View GitHub Profile
{ "write" : "one" }
@jrunning
jrunning / foo.js
Created April 24, 2011 04:16
Getting a class property from an instance of a Backbone.js model (without naming the class explicitly)
var C = Backbone.Model.extend({
foo : function() { return this.constructor.bar; }
}, {
bar : 123
});
var ci = new C;
ci.foo();
// -> 123
@jrunning
jrunning / gist:1110438
Created July 27, 2011 21:40
Database Normalization 101
!! BEFORE: one table
`some_table`
some_col | another_col | ascii_stuff
---------+-------------+------------
abc | ... | xyzzy
abc | ... | idspispopd
uvw | | idspispopd
wzy | | it is a good day to die
@jrunning
jrunning / gist:1134761
Created August 9, 2011 18:13
FFFFfuuuuuuuu
Fhqwhgads:IntroMe (design)$ rake db:setup --trace
(in /Users/jordan/Documents/Dev/IntroMe)
** Invoke db:setup (first_time)
** Invoke db:create (first_time)
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:create
db/test.sqlite3 already exists
MIME-Version: 1.0
Received: by 10.147.40.10 with HTTP; Wed, 12 Oct 2011 12:14:39 -0700 (PDT)
Date: Wed, 12 Oct 2011 14:14:39 -0500
Delivered-To: jrunning@g***l.com
Message-ID: <CAEi5Ti8cXuMF=XCrFH1s1W3S_oMnZL66SrGkryW1vi2E-quzYQ@mail.gmail.com>
Subject: Test
From: Jordan Running <jrunning@g***l.com>
To: Jordan Running <jrunning+foo@g***l.com>
Content-Type: multipart/alternative; boundary=000e0cd4d5c0e4c1b804af1ed5ab
@jrunning
jrunning / gist:1287755
Created October 14, 2011 17:33
CoffeeScripty code
$('#fixHead td.change').click (evt)-> # jQuery will automatically add the event handler to
# every matching element, no need for $.each.
evt.preventDefault() # instead of returning false in an event handler
# (this is a general JS tip, not just CS)
$this = $ this # since you use $(this) twice, just keep it around
$('#contactArea').load $this.data 'content' # parentheses are optional...
$("#ui-dialog-title-dialog").text($this.attr 'title') # but still useful for clarity
centerPopup()
loadPopup()
@jrunning
jrunning / Notes.md
Created November 21, 2011 00:46
Files injected by "Love you" script c. 2011-11-11 (my comments denoted by `{jrunning}`)

Image of "Love you" "dashboard"

Image of "dashboard"

Usage

$ chmod a+x matts_split.sh

$ ./matts_split.sh path/to/blob_file.baz path/to/tab_separated_offsets.tab

SELECT tblPeople.[First Name], tblPeople.Email
FROM tblPeople
INNER JOIN tblMembership ON tblPeople.[Person ID] = tblMembership.[Person ID]
WHERE tblMembership.[Valid To] IN (#12/31/2012#) AND
tblPeople.Email IS NOT NULL
ORDER BY tblPeople.Email
;