Skip to content

Instantly share code, notes, and snippets.

View tcql's full-sized avatar
💭
juice is fruit milk

Tim Channell tcql

💭
juice is fruit milk
  • Washington, DC
View GitHub Profile
$driver = $this->pdo->getAttribute(\PDO::ATTR_DRIVER_NAME);

$this->pdo->beginTransaction();

try {
    // SERIALIZABLE transactions fail if multiple of them
    // even try to touch the same rows at the same time
    if ($driver == "pgsql") {
        $isolation = $this->pdo->prepare(
./node_modules/turf-aggregate/index.js
172:6 error unrecognizedError is defined but never used no-unused-vars
./node_modules/turf-along/index.js
64:1 error Missing semicolon semi
./node_modules/turf-average/index.js
110:59 error done is defined but never used no-unused-vars
121:1 error Missing semicolon semi
./turf_modules/turf-hex/index.js
41:6 error cellHeight is defined but never used no-unused-vars
99:11 error i is already declared in the upper scope no-shadow
./turf_modules/turf-isobands/index.js
40:6 error addEdgesResult is defined but never used no-unused-vars
65:19 error Don't make functions within a loop no-loop-func
77:11 error x is already defined no-redeclare
98:31 error c is already declared in the upper scope no-shadow
117:4 error sizeResult is defined but never used no-unused-vars
@tcql
tcql / fizzbuzz1.hs
Created January 26, 2012 02:56
the Fizz Buzz problem, solved in Haskell
import Control.Monad (mapM_)
fizzbuzz = [0..100] >>= \x -> return (
case (x `mod` 3, x `mod` 5) of
(0,0) -> "FizzBuzz";
(0,_) -> "Fizz";
(_,0) -> "Buzz";
(_,_) -> show x)
main = mapM_ putStrLn fizzbuzz
@tcql
tcql / haskellpowerset.hs
Created February 7, 2012 03:11
Haskell Powerset
{-
Calling powerset with a list
will return a list of all combinations of elements in the list. Example:
powerset [1,2,3]
returns : [[1,2,3],[1,2],[1,3],[1],[2,3],[2],[3],[]]
-}
import Control.Monad
@tcql
tcql / gist:1806486
Created February 12, 2012 05:10
Making CoffeeScript more Haskell-y
## The more functional way
head = (x) -> ((z,zs...) -> z) x...
tail = (x) -> ((z,zs...) -> zs) x...
last = (x) -> ((zs...,z) -> z) x...
init = (x) -> ((zs...,z) -> zs) x...
## OR, the more coffee-scripty way:
headCS = (xs) -> xs[0]
tailCS = (xs) -> xs[1..xs.length]
initCS = (xs) -> xs[0...xs.length-1]
@tcql
tcql / gist:1856724
Created February 18, 2012 01:20
FizzBuzz, in Grin
}}}}}}}}}}$*$[>}~-$]<[$>\>_}}}}}${{*$<<%&[(Fizz Buzz)){{]}[>$<\>>_}}}}}$<<%&[(Buzz)){{]}[>$<\>>_}}}$<<%&[(Fizz)){{]}[>:)<_]]]<]
@tcql
tcql / gist:6366841
Last active December 21, 2015 21:18
first Leaflet layer! Still could use some cleanup and whatnot, but It works pretty well.
class L.PolyCircle extends L.Path
options:
polyOptions: {}
nodes: 16
initialize: (center, radius, options)->
L.setOptions @,options
git clone https://github.com/tchannel/phaser-coffeescript.git
cd phaser-coffeescript
# The branch i'm testing on. The phaser dependency
# Is pointing at a fork I made of phaser (tchannel/phaser)
# Where i setup the sourcemap and build tasks
git checkout origin/test-phaser-sourcemap
npm install

Download

Download and unzip... wherever you feel like: Phaser Project

Install

In whatever folder you unzipped into:

npm install