Skip to content

Instantly share code, notes, and snippets.

View garrickp's full-sized avatar

Garrick Peterson garrickp

  • Dataminr Inc.
  • Bozeman, MT
View GitHub Profile
@garrickp
garrickp / gist:391d708252ab0a67b1a2
Last active August 29, 2015 14:22
htpasswd from state.show_highstate
vagrant@docker-vagrant:~$ sudo salt-call --local --out=json state.show_highstate
{
"local": {
[...]
"htpasswd.user_exists-348443333440258948": {
"htpasswd": [
{
"htpasswd_file": "/etc/nginx/docker-registry.htpasswd"
},
{
@garrickp
garrickp / .gitconfig
Created May 14, 2015 19:57
Git Aliases
[alias]
co = checkout
s = status
b = branch
a = add
c = commit
d = diff --ignore-space-at-eol --ignore-blank-lines
ec = config --global -e
up = !git pull --prune $@ && git submodule update --init --recursive
cob = checkout -b
@garrickp
garrickp / gist:9191287c36b69ed59d58
Created December 23, 2014 23:14
Whisper File Format
## Header ##
0000000 00 00 00 01 # Aggregation method of 1: average
00 00 08 70 # Max Storage of 2,160 seconds
3f 00 00 00 # X Files Factor of 0.5
00 00 00 03 # Archive Count of 3
## Archive List ##
0000010 00 00 00 34 # Archive 1: Offset within the file
00 00 00 0a # Archive 1: Seconds per point: 10
00 00 00 06 # Archive 1: Points: 6
00 00 00 7c # Archive 2: Offset within this file
@garrickp
garrickp / Comparison Problem
Created November 3, 2014 16:21
Comparison not working
enum Ordering {
Less,
Equal,
Greater,
}
fn cmp(a: int, b: int) -> Ordering {
if a < b { Less }
else if a > b { Greater }
else { Equal }