Skip to content

Instantly share code, notes, and snippets.

View nickbauman's full-sized avatar
🎯
Focusing

Nick Bauman nickbauman

🎯
Focusing
View GitHub Profile
@nickbauman
nickbauman / gist:9eff03186a74ff8ca3a3
Created August 15, 2014 22:01
GAE app identity, version and deploy time example
# 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
@nickbauman
nickbauman / ios_imperatives_for_approval.md
Last active November 1, 2019 12:10
Condensed iOS Human Interface Guidelines, formulated as imperatives.

Condensed iOS Human Interface Guidelines

Imperatives for AppStore approval

For iPhone app developers. Emphasis on getting the fastest app store approval. Everything stated as suggestion made into an imperative. When "violating" these imperatives, you can check for yourself what the caveats are. Generally speaking, deviating will more likely cause your app to be hung up in approval.

You can read this entire document in about 20 minutes. This is faster than reading and understanding the entire Human Interface Guidelines.

Overview

@nickbauman
nickbauman / rpi_backup_recover.sh
Created January 14, 2014 03:16
Mac backup your raspberry pi. Requires SSH client, dd, gzip installed
#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
@nickbauman
nickbauman / gist:5148590
Last active December 14, 2015 21:08
"Brute force" find farthest points in a 2D graph.
(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'"
@nickbauman
nickbauman / hb_posgres
Created June 25, 2012 19:38
Problems with homebrew installing postgress
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