I hereby claim:
- I am micmarsh on github.
- I am micmarsh (https://keybase.io/micmarsh) on keybase.
- I have a public key whose fingerprint is 960F 064A BB01 F97C 1A15 FCE6 3B81 08D4 B735 857C
To claim this, I am signing this object:
# While coffee script offers a "class" keyword, methods still aren't that closely | |
# associated with class instances. Include fixScoping(this) at the beginning | |
# of all of your constructors to make that class' methods well behaved by javascript standards | |
fixScoping = (instance) -> | |
for property, value of instance | |
do (property, value) -> #b/c javascript | |
if typeof value is "function" | |
instance[property] = (args...) -> value.apply(instance, args) |
COMPILED_COFFEE = ' < -' | |
PLAIN_JS = '<-' | |
thenify = (lines) -> | |
[line, rest...] = lines | |
if rest.length is 0 | |
line | |
else if line.search(PLAIN_JS) > 0 or line.search(COMPILED_COFFEE) > 0 | |
[value, promise] = line.split if line.search(PLAIN_JS) > 0 then PLAIN_JS else COMPILED_COFFEE | |
noSemiColon = promise.slice(0, -1) |
import System.Directory | |
import System.IO (hFlush, stdout) | |
import Control.Exception (try, SomeException) | |
-- "Downloads" folders tend to get unwieldy. | |
-- This will force a decision on every downloaded file, with | |
-- a strong bias towards deletion. | |
type RemoveResult = IO (Either SomeException ()) |
Verifying myself: My Bitcoin username is +micmarsh. https://onename.io/micmarsh |
import System.Directory as D | |
import Data.List (sort, cycle) | |
import Data.Set (fromList, member, Set) | |
import Data.List.Split (chunksOf) | |
import Data.Time.Calendar as C | |
import Control.Monad (sequence_) | |
-- Date parsing related functions | |
slice :: Int -> Int -> [a] -> [a] |
I hereby claim:
To claim this, I am signing this object:
DROP TABLE test_notes; | |
DROP TABLE billing_discount_notes; | |
drop table billing_notes; | |
DROP TABLE billing_discounts; | |
CREATE TABLE billing_notes ( | |
id SERIAL PRIMARY KEY, | |
note text, | |
created TIMESTAMP WITHOUT TIME ZONE, | |
updated TIMESTAMP WITHOUT TIME ZONE |
#!/bin/bash | |
# essentials | |
sudo apt-get install git curl emacs24 vim cowsay | |
# sublime | |
sudo add-apt-repository ppa:webupd8team/sublime-text-2 | |
sudo apt-get update | |
sudo apt-get install sublime-text |
; Clojure actually has a queue type, but it's not easily accesible. Here's a function to help with that | |
(defn queue | |
([] clojure.lang.PersistentQueue/EMPTY) | |
([& elements] | |
(into (queue) elements))) |
# use lodash/underscore, this could probably actually be a mixin for those | |
compose = (fns) -> | |
_.reduceRight fns, (composed, currentFn) -> | |
_.compose (valueOrPromise) -> | |
vop = valueOrPromise | |
if Boolean vop and vop.then | |
vop.then (value) -> | |
currentFn value | |
else | |
currentFn vop |