I hereby claim:
- I am nickbauman on github.
- I am nickbbuzzfeed (https://keybase.io/nickbbuzzfeed) on keybase.
- I have a public key whose fingerprint is 98DD 9A39 33A9 9607 756A 1816 07E7 7FC3 9629 7825
To claim this, I am signing this object:
# config | |
def _APP_VERSION(): | |
if on_development_server or not on_server: | |
return "0", 0 | |
else: | |
version_time = os.environ['CURRENT_VERSION_ID'] | |
return (version_time.find('.') > -1 and version_time.split('.')) or (version_time, -1) | |
config.APP_VERSION = _APP_VERSION() | |
# Useage in a handler |
brew --config | |
HOMEBREW_VERSION: 0.9 | |
HEAD: fc0b4b636a366db1d66db216db380d9c2a4c7a82 | |
HOMEBREW_PREFIX: /usr/local | |
HOMEBREW_CELLAR: /usr/local/Cellar | |
CPU: dual-core 64-bit penryn | |
OS X: 10.7.4 | |
Kernel Architecture: x86_64 | |
Xcode: 4.3.3, CLT 4.3.0.0.1.1249367152 | |
GCC-4.0: N/A |
(defn find-distance | |
"Pthagorian distance. Functions x and y are just wrappers around a two-item seq." | |
[a-coord b-coord] | |
(let [xsize (- (x a-coord) (x b-coord)) | |
ysize (- (y a-coord) (y b-coord))] | |
(sqrt (+ (* xsize xsize) (* ysize ysize))))) | |
(defn find-farthest-point | |
"Takes a point 'pt' (a two-item seq of numbers) and a seq of points and returns | |
the farthest point away from 'pt' in 'pt-list'" |
I hereby claim:
To claim this, I am signing this object:
# For the ~/.gitconfig file: | |
[alias] | |
st = status | |
co = checkout | |
ci = commit | |
cp = cherry-pick | |
br = branch | |
undo = reset HEAD~1 --mixed | |
back = stash pop |
(defentity AnotherEntity [content saved-time int-value]) | |
(deftest test-query-language | |
(testing "query entity with predicates" | |
(let [entity (save! (create-AnotherEntity "Some content woo" (t/date-time 1980 3 5) 6)) | |
entity2 (save! (create-AnotherEntity "Other content" (t/date-time 1984 10 12) 17))] | |
; query all | |
(is (= (list entity entity2) (query-AnotherEntity []))) | |
; equality | |
(is (= (list entity) (query-AnotherEntity [:content = "Some content woo"]))) |
The goal is to insert an integer into an ordered list-like thingy. | |
Here's Go. | |
// Given g | |
g := []int{1, 2, 3, 4} | |
// Insert 44 in the middle of it | |
append(g[:2], append([]int{44}, g[2:]...)...) |
I hereby claim:
To claim this, I am signing this object:
from github3 import login | |
# Python 3 | |
prompt = input | |
if __name__ == '__main__': | |
if len(sys.argv) > 1: | |
passwd = prompt('Enter password: ') |
#Mac Backup your Raspberry Pi | |
#Backup remotely (requires public key exchange for pi account): | |
ssh pi@raspberry sudo dd if=/dev/mmcblk0 | gzip -c > raspberry.img.gz | |
#Recover (requires locally mounted disk device rdisk1): | |
gzip -dc /path/to/raspberry.img.gz | sudo dd of=/dev/rdisk1 bs=1m |