Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / ruby_notes.mdown
Created August 30, 2011 18:38
Ruby notes

Notes on the Ruby programming language

Documentation

Ruby Docs

Local docs using BASH

ri upcase # documents for upcase method
@nifl
nifl / grok_vi.mdown
Created August 29, 2011 17:23
Your problem with Vim is that you don't grok vi.

Answer by Jim Dennis on Stack Overflow question http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118

Your problem with Vim is that you don't grok vi.

You mention cutting with yy and complain that you almost never want to cut whole lines. In fact programmers, editing source code, very often want to work on whole lines, ranges of lines and blocks of code. However, yy is only one of many way to yank text into the anonymous copy buffer (or "register" as it's called in vi).

The "Zen" of vi is that you're speaking a language. The initial y is a verb. The statement yy is a simple statement which is, essentially, an abbreviation for 0 y$:

0 go to the beginning of this line. y yank from here (up to where?)

@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