Skip to content

Instantly share code, notes, and snippets.

@nifl
nifl / axlesofevil.md
Last active August 29, 2015 14:03
Some bike polo content lifted from the Axles of Evil, the origin of "Little Beirut" bike polo. Note this was taken from a 2004 snapshot from archive.org and as such the days and times are no longer valid AFAIK.

bike polo is dead. long live bike polo!

in our attempts to free ourselves from the harrassment and persecution we have endured from the city of Portland, we have fallen into their trap. Without paying excrutiating sums to the corrupt city department of parks and recreation, and the profiteering insurance companies, the city has told us, we can no longer play our beloved game on city property. FIE! FIE! to this challenge we say that we will never give up! we will never give in! Back to the underground. a change of venues, and and a adaption of strategy, and we're back on our feet. This means that in order find out about bike polo, you must SHOW UP to bike polo. There will be no more advertisement. We will be yr. sole source of information for all things in the bike polo revolution! VIVE LA RESISTANCE! RIDE BIKES THROW BRICKS!!!

until we are physically removed, we continue to play at the following places and times:

  • Wednesday 6:30pm -> Colonel Summers Park : SE 20th & Belmont
  • ~~Sunday 2pm -> Alberta
layout title date comments sharing footer
page
index
2013-08-30 12:07
false
false
true

Overview

@nifl
nifl / js_notes.md
Last active September 26, 2015 20:57
JavaScript Notes

Javascript notes

JS is ...

  • Interpreted, not compiled
  • Case-sensitve
  • Whitespace insensitive except within quotes

Placement

@nifl
nifl / sieve.js
Created October 26, 2012 22:43
Sieve Of Eratosthenes
function sieve(max) {
var D = [], primes = [];
for (var q=2; q<max; q++) {
if (D[q]) {
for (var i=0; i<D[q].length; i++) {
var p = D[q][i];
if (D[p+q]) D[p+q].push(p);
else D[p+q]=[p];
}
delete D[q];
@nifl
nifl / database.yml
Created October 30, 2012 23:52
Database.yml example using defaults for test, production, and cucumber
development: &defaults
adapter: postgresql
encoding: utf8
database: surveys_development
pool: 5
username: john
password: appleseed
test: &test
<<: *defaults
@nifl
nifl / fizzbuzz.js
Created November 2, 2012 04:17
FizzBuzz
for (i = 1; i <= 20; i++) {
if (i % 3 === 0) {
if (i % 5 === 0) {
console.log("FizzBuzz");
} else {
console.log("Fizz");
}
} else if (i % 5 === 0) {
console.log("Buzz");
} else {
@nifl
nifl / qbAPI.cfc
Created November 19, 2012 16:26
Quickbase REST API calls
<!---
Name: qbAPI.cfc
Author: Gernot Bartels
Description: Methods to interact with QuickBase
History: Migrated from CF8 to Railo 2010-04-02.
Created: 2009-03-25
Updated: 2010-04-02
--->
<cfcomponent output="false">
<!--- Login --->
@nifl
nifl / record.cfm
Created November 19, 2012 18:35
Queries QB for record object. If record ID exists, update; Otherwise create new record.
<!---
Name: record.cfm
Author: Gernot Bartels
Description: Queries QB for record object.
If record ID exists, update;
Otherwise create new record.
History: Created
Added logic
Usage: Surveys, Intake,
Created: 2011-08-05
<!---
Name: intake_xml.cfm
Author: Gernot Bartels
Description: Intake Application cfsavecontent object
Returns new record or update data.
History: Created
Usage: Surveys, Intake,
Created: 2012-09-05
Updated: 2012-10-15
--->
@nifl
nifl / check_object_instance.md
Created November 26, 2012 20:17
It is NOT 'bad' to use the new keyword. But if you forget it, you will be calling the object constructor as a regular function. If your constructor doesn't check its execution context then it won't notice that 'this' points to different object (ordinarily

And yes, new has one crucial disadvantage, ably described by other answers: if you forget to use it, your code will break without warning. Fortunately, that disadvantage is easily mitigated - simply add a bit of code to the function itself:

function foo()
{
   // if user accidentally omits the new keyword, this will 
   // silently correct the problem...
   if ( !(this instanceof foo) )
      return new foo();

// constructor logic follows...