Skip to content

Instantly share code, notes, and snippets.

View jvoorhis's full-sized avatar

Jeremy Voorhis jvoorhis

View GitHub Profile
### Keybase proof
I hereby claim:
* I am jvoorhis on github.
* I am jvoorhis (https://keybase.io/jvoorhis) on keybase.
* I have a public key whose fingerprint is 7B7C E4F1 C208 5E0B 9214 2CED 69B9 3D79 8820 3462
To claim this, I am signing this object:
; ModuleID = 'Kaleidescope'
declare i32 @putchar(i32)
define double @put(double) {
%2 = fptoui double %0 to i32
%3 = call i32 @putchar(i32 %2)
ret double %0
}
package main
import (
"encoding/json"
"fmt"
"net/http"
"io/ioutil"
)
type Deploy struct {
$ free -h
total used free shared buffers cached
Mem: 114G 1.6G 113G 0B 24M 754M
-/+ buffers/cache: 815M 114G
Swap: 0B 0B 0B
@jvoorhis
jvoorhis / routes.rb
Created February 11, 2013 23:46
Static asset resource for webmachine.rb
app.routes do
add ['*'], Resources::Static
end
@jvoorhis
jvoorhis / config.rb
Created January 18, 2013 06:25
Sample llvm/config.rb
module LLVM
module CONFIG
VERSION = "3.2"
PREFIX = "/usr/local/Cellar/llvm/3.2"
SRC_ROOT = "/private/tmp/llvm-U6Ok/llvm-3.2.src"
OBJ_ROOT = "/private/tmp/llvm-U6Ok/llvm-3.2.src"
BIN_DIR = "/usr/local/Cellar/llvm/3.2/bin"
INCLUDE_DIR = "/usr/local/Cellar/llvm/3.2/include"
LIB_DIR = "/usr/local/Cellar/llvm/3.2/lib"
CPP_FLAGS = ["-I/usr/local/Cellar/llvm/3.2/include", "-D_DEBUG", "-D_GNU_SOURCE", "-D__STDC_CONSTANT_MACROS", "-D__STDC_FORMAT_MACROS", "-D__STDC_LIMIT_MACROS"]
@jvoorhis
jvoorhis / chef_server_backup.rb
Created November 13, 2012 22:43
knife exec chef_server_backup.rb
#
# Author:: Joshua Timberman (<joshua@opscode.com>)
# Author:: Adam Jacob (<adam@opscode.com>)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
~/Projects/mote % cat misc/mote.yml
sensors:
- Mem
- Load
- Disk
outputs:
- Stdout
~/Projects/mote % ./bin/mote -c misc/mote.yml
{"timestamp":"2012-08-21 13:37:13 -0700","sensor":"mem","values":{"total":8589934592,"used":8567566336,"free":22368256}}
if usage[:cpu] > BEGIN_RENICE_CPU_THRESHOLD
nice = (instance[:nice] || 0) + 1
if nice < MAX_RENICE_VALUE
instance[:nice] = nice
@logger.info("Lowering priority on CPU bound process(#{instance[:name]}), new value:#{nice}")
%x[renice #{nice} -u #{instance[:secure_user]}]
end
end
[7] pry(main)> ls 42
Comparable#methods: between?
Numeric#methods: +@ abs2 angle arg coerce conj conjugate eql? i imag imaginary nonzero? phase polar pretty_print pretty_print_cycle quo real real? rect rectangular remainder singleton_method_added step to_c
Integer#methods: ceil chr denominator downto floor gcd gcdlcm integer? lcm next numerator ord pred rationalize round times to_i to_int to_r truncate upto
Fixnum#methods: % & * ** + - -@ / < << <= <=> == === > >= >> [] ^ abs div divmod even? fdiv magnitude modulo odd? size succ to_f to_s zero? | ~