This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use a pure function to do your fancy stuff! (note that we CAN'T do all that manipulation in an as block) | |
// uses the parameter style of asyncifying modules | |
Entity.findByProgram = as(Entity, AugmentedProgram, function(Entity, AugmentedProgram, programId) { | |
var programs = AugmentedProgram.findByProgram(programId) | |
var entitiesWithOffsets = programs.map(function(program) { | |
var entity = Entity.findByName(program.name) | |
return {offset: program.offset, entity: entity} // we'll need both to sort, below | |
}) | |
return Entity.groupByOffset(entitiesWithOffsets) | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var path = require('path') | |
var fs = require('fs') | |
// FS EXAMPLE - concat all js files in dir and save to destFile | |
// This is normal node.js code | |
function concatJsFiles(dir, destFile, cb) { | |
fs.readdir(dir, function(err, files) { | |
if (err) return cb(err) | |
// Filter *.js files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data ListWriter = ListWriter [String] | |
runListWriter :: ListWriter -> [String] | |
runListWriter (ListWriter xs) = xs | |
execListWriter :: ListWriter -> [String] | |
execListWriter = runListWriter | |
instance Monad ListWriter where | |
return a = ListWriter [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~$ ghc --make Hello.hs | |
Linking Hello ... | |
Undefined symbols for architecture x86_64: | |
"_locale_charset", referenced from: | |
_localeEncoding in libHSbase-4.4.1.0.a(PrelIOUtils.o) | |
"_iconv_close", referenced from: | |
_hs_iconv_close in libHSbase-4.4.1.0.a(iconv.o) | |
(maybe you meant: _hs_iconv_close) | |
"_iconv", referenced from: | |
_hs_iconv in libHSbase-4.4.1.0.a(iconv.o) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Apr 4 08:46:20 squid Installer[513]: @(#)PROGRAM:Install PROJECT:Install-686.3 | |
Apr 4 08:46:20 squid Installer[513]: @(#)PROGRAM:Installer PROJECT:Installer-530 | |
Apr 4 08:46:20 squid Installer[513]: Hardware: MacBookPro8,3 @ 2.20 GHz (x 8), 8192 MB RAM | |
Apr 4 08:46:20 squid Installer[513]: Running OS Build: Mac OS X 10.7.3 (11D50d) | |
Apr 4 08:46:20 squid Installer[513]: Env: PATH=/usr/bin:/bin:/usr/sbin:/sbin | |
Apr 4 08:46:20 squid Installer[513]: Env: TMPDIR=/var/folders/q1/xlvxykrx4558krd_ghgpxxlw0000gn/T/ | |
Apr 4 08:46:20 squid Installer[513]: Env: SHELL=/bin/bash | |
Apr 4 08:46:20 squid Installer[513]: Env: HOME=/Users/seanhess | |
Apr 4 08:46:20 squid Installer[513]: Env: USER=seanhess | |
Apr 4 08:46:20 squid Installer[513]: Env: LOGNAME=seanhess |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define [ | |
'text!views/start/Watchers.html' | |
'views/View' | |
'cs!models/Watchers' | |
'cs!views/start/Watcher' | |
], (template, View, WatchersCollection, Watcher) -> | |
class Watchers extends View | |
template: template | |
initialize: () -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~$ cabal install cabal cabal-install | |
Resolving dependencies... | |
cabal: cannot configure unix-2.4.2.0. It requires base >=4.2 && <4.4 | |
For the dependency on base >=4.2 && <4.4 there are these packages: | |
base-4.2.0.0, base-4.2.0.1, base-4.2.0.2, base-4.3.0.0 and base-4.3.1.0. | |
However none of them are available. | |
base-4.2.0.0 was excluded because base-4.5.0.0 was selected instead | |
base-4.2.0.0 was excluded because of the top level dependency base -any | |
base-4.2.0.1 was excluded because base-4.5.0.0 was selected instead | |
base-4.2.0.1 was excluded because of the top level dependency base -any |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
request = require 'request' | |
# curl -u TOKEN:X -H 'Content-Type: application/json' -d '{"message":{"body":"Hello"}}' https://DOMAIN.campfirenow.com/room/ROOMID/speak.json | |
exports.room = room = (account, room, token) -> | |
send = (message, cb) -> | |
query = | |
url: "https://#{token}:X@#{account}.campfirenow.com/room/#{room}/speak.json" | |
json: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{Model, Document} = | |
# make a db a-la mongodb-wrapper or mongolian | |
class Users extends Model | |
users = new Users db.collection 'users' | |
user = users.create {name: "Sean"} | |
user.save (err) -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let mapleader = "\<space>" | |
call pathogen#runtime_append_all_bundles() | |
call pathogen#helptags() | |
call pathogen#infect() | |
syntax on | |
filetype plugin indent on | |
filetype plugin on |