Skip to content

Instantly share code, notes, and snippets.

View aaronj1335's full-sized avatar
🤠

Aaron Stacy aaronj1335

🤠
View GitHub Profile
@aaronj1335
aaronj1335 / core.clj
Created March 15, 2014 21:03
re-bind a random number generator for testing
(ns my-lib.core)
(def my-rand rand)
(defn my-fn []
(take 3 (repeatedly my-rand)))
@aaronj1335
aaronj1335 / hmm.clj
Last active August 29, 2015 13:57
debugging slow code
(defn tokens-and-labels [labeled-tokens]
"given a sequence of token/label pairs, return a set of the tokens and a set
of the labels"
;{:tokens (set (map first labeled-tokens))
; :labels (set (map second labeled-tokens))})
(reduce
(fn [{:keys [tokens labels]} [token label]]
{:tokens (conj tokens token)
:labels (conj labels label)})
{:tokens #{} :labels #{}}
@aaronj1335
aaronj1335 / collection.js
Last active August 29, 2015 13:57
waterfall data layer
define([
'underscore',
'knockout'
], function(_, ko) {
function Collection() {
}
Collection.prototype.init = function() {
this._instances = ko.observableArray();

Keybase proof

I hereby claim:

  • I am aaronj1335 on github.
  • I am aaronj1335 (https://keybase.io/aaronj1335) on keybase.
  • I have a public key whose fingerprint is 2472 ABA4 E784 FD7F 8DC2 9F88 B24A 6CEE 6E37 E0E8

To claim this, I am signing this object:

-----BEGIN PGP MESSAGE-----
Version: GnuPG v1.4.15 (Darwin)
hQEMA8vwn2/WnOHnAQf/bvUr5XlqDRScy1TJjrwHOeYDMxqvrZQmyftQqAUn7rUs
ooukQR2t8An2Gk87af9xd7BknfkBGVdahKI6+VRcoaE+8wet+WCB3Looh9n1u3T9
Kgc/nXN+kHM4lYRhJLX9UjINAjT5n7zQ8ks2bX9zWdPniErRQL8ICzwvh3DCR2qH
d1ecXWZIS0aTEeFjv3Jq0X9v151ICj6fbOacBGLBZQN4v0qFv0H/X0ygSxyeE7o9
UGKFPdpJ+xJX7k+ctlqiNgGiXhvOdmT1eNFm8HzL76TXpqOyOchWI7AsxHmAofKd
Y0zQD3XKXNnDj+oU4dHHGedpmaTQHEgTwiH6S9vzAdLpAWBkMV8tLPlKbru3nm1/
b+a5pelL8YroXEJ/Dit1lJuJvcJjppWK59ZKv6Gurke8Ckjd0Iglw+iqPJyQmsX+
alex
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1.4.15 (Darwin)
hQEMAwHibJYV/8LnAQf+ODPFERaiSMR5mpwnIzCVUsp/0W8PQOHFQ03X2El5nea2
qMC6NGJ42acnxam4KWwFs9Hrv9uxojrZ7JAemoAz9TrTOtjnRFfWwYsQJCNUnYO4
QxYWrQ6HHlUwbOU0TCohslf49Vrc/WRWEhQ9GMLKGKuD/4WwdHJd4FCFIqSKJI4D
66vsyQXXusao6qQPbt9NYvlZVND9U43BcLSC8SebvxcptTfFggBIuY2A1SvcH9yL
GIt9Mh7D+NdmqGXU9DusVJSVHT/Yj7Er1TaEG4lNuyrOkxP2KZO8azDBXW1e5y1s
@aaronj1335
aaronj1335 / error.txt
Last active August 29, 2015 14:00
why can't i return a non-const string from line_iterator::dereference() (line 32). if i change it to `const string& dereference() const` it compiles.
astacy∂ʇoqǝɔɐʇs ☠ ~/Downloads/11219461 12:54:30 Apr23
§ g++-4.8 -Wall -Werror -g -L/Users/astacy/boost/lib -I/Users/astacy/boost/include -o test test.cpp
test.cpp: In member function 'std::string& line_iterator::dereference() const':
test.cpp:33:12: error: invalid initialization of reference of type 'std::string& {aka std::basic_string<char>&}' from expression of type 'const string {aka const std::basic_string<char>}'
return line;
^
@aaronj1335
aaronj1335 / .gitignore
Last active August 29, 2015 14:00
can i make this faster by reducing string copies? are there other things i can do to make this faster?
main
#!/usr/bin/env node --harmony
function setup() {
var net = require('net');
var fs = require('fs');
var irc = require('irc-js');
var Notifier = require('node-notifier');
var notifier = new Notifier();
Using worker: worker-linux-3-1.bb.travis-ci.com:travis-linux-17
Installing an SSH key
$ git clone --depth=50 git@github.com:WaterfallEngineering/frontend.git WaterfallEngineering/frontend
Cloning into 'WaterfallEngineering/frontend'...
Warning: Permanently added the RSA host key for IP address '192.30.252.128' to the list of known hosts.
remote: Counting objects: 1382, done.
remote: Compressing objects: 100% (1035/1035), done.