I hereby claim:
- I am travisdahlke on github.
- I am travisd (https://keybase.io/travisd) on keybase.
- I have a public key whose fingerprint is 1D08 EC6D 3564 9388 EB17 3193 AB2B F207 D73E E5F8
To claim this, I am signing this object:
0493501e5e56d04d536e2756649222383e40c082d59547f51516bf5a425f705d1335b34e15b7e824a7ff7089c86a5c46b00bcbad3ed9c4c18d19b598d45221ee45 |
<!DOCTYPE html> | |
<html > | |
<head> | |
<title>deco</title> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<meta name="csrf-param" content="authenticity_token" /> | |
<meta name="csrf-token" content="MNt1KcKC+OArhq5ZheeoEGzsYX/OzEPvLFI9XrIL2N03Fuimu2oISR9+I23+2eTxljGnh1/OnyZ70LBZMR7MZA==" /> | |
<title>Deco</title> | |
<meta name="twitter:card" content="summary" /> |
#!/usr/bin/python | |
import ledger | |
import sys | |
import re | |
def account_name(post): | |
account = post.account.fullname().replace(" ","").replace("(","").replace(")","").replace("'","") | |
return re.sub(r'\:(\d)',r':X\1', account) | |
I hereby claim:
To claim this, I am signing this object:
class Thing | |
def foo | |
"foo" | |
end | |
def bar | |
puts foo | |
if foo.nil? | |
foo = "bar" | |
end |
# This option has the most clarity, but I generally hate local variables in a | |
# method, preferring to use tap. | |
def calculated_foo | |
available_foos = [] | |
available_foos << bar | |
available_foos << baz.qux if baz | |
available_foos.max | |
end | |
# It's a little less clear, unless you know what tap is, and `end.max` is |
use agg_test; | |
test_add = function() { | |
var t = db.things; | |
t.drop(); | |
t.insert({a: 2, b: 3}); | |
var total1 = t.aggregate({$project:{total:{$add:["$a","$b"]}}}).result[0].total; | |
print("a + b = " + total1); | |
var total2 = t.aggregate({$project:{total:{$add:["$a","$b","$c"]}}}).result[0].total; | |
print("a + b + c = " + total2); |