Skip to content

Instantly share code, notes, and snippets.

View freeformz's full-sized avatar

Edward Muller freeformz

View GitHub Profile
test ()
test muffin item
fn main() {
let item = "muffin";
let thing1;
if item == "salad" {
thing1 = "salad item";
} else if item == "muffin" {
thing1 = "muffin item";
fn main() {
let item = "muffin";
let thing1;
if item == "salad" {
thing1 = "salad item";
} else if item == "muffin" {
thing1 = "muffin item";
{22:09}[2.1.3]~/go/src/github.com/heroku/log-shuttle:go-metrics ✗ ➭ godep go test ./... -bench=. -benchmem
? github.com/heroku/log-shuttle [no test files]
log-shuttle: 2014/11/11 22:09:29 at=post retry=true msgcount=1 inbox.length=0 request_id="4cd4505f-e5c1-4530-4823-e9795b8bc1ba" attempts=1 error="Post https://token:token@127.0.0.1:52762: EOF" errtype="*errors.errorString"
PASS
BenchmarkBatcher 50 28265753 ns/op 24225291 B/op 101642 allocs/op
BenchmarkLogplexLineFormatter 1000000 1705 ns/op 817 B/op 6 allocs/op
BenchmarkLogplexLineFormatter_WithHeaders 1000000 1768 ns/op 817 B/op 6 allocs/op
BenchmarkLogplexBatchFormatter 50000 70428 ns/op 25402 B/op 209 allocs/op
BenchmarkLogplexBatchFormatter_WithHeaders 20000 78171 ns/op 41756 B/op 210 allocs/op
BenchmarkReaderWithFrontBuffEqual0 10 169082868 ns/op 296.31 MB/s 51216806 B/op 100255 allocs/op
#!/bin/bash
# Display the packages that your code imports / depends on that
# are not in the go std lib.
result=()
#my deps
# NOTE: Requires jq
mine=($(go list -json | jq '.Imports + .Deps | .[]' | sort -u | sed -e 's/"//g'))
FROM heroku/cedar:14
RUN useradd -d /app -m app
USER app
WORKDIR /app
ENV HOME /app
ENV RUBY_ENGINE 2.2.1
ENV BUNDLER_VERSION 1.7.12
ENV NODE_ENGINE 0.10.38
@freeformz
freeformz / piper.rb
Created September 24, 2010 02:48
silly piper
READ_BUF = 1024
HIGH_WATER = 1024
$fin = nil
$fout = nil
def open_fin
if $fin.nil? || ($fin.is_a?(File) && ($fin.eof? || $fin.closed?))
@freeformz
freeformz / collectd-configure-vmware.patch
Created November 24, 2010 01:30
vmware client sdk plugin for collectd. Against collect 4.7.4
--- configure.in
+++ configure.in
@@ -3337,6 +3337,7 @@
dependency_warning="no"
dependency_error="no"
+plugin_vmware="yes"
plugin_ascent="no"
plugin_battery="no"
plugin_bind="no"
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
largestDivisible :: Integer
largestDivisible = head (filter p [100000,99999..])
where p x = x `mod` 3829 == 0
Solved!
Oh duh. It's a function!
p x = x `mod` 3829 == 0
p takes x and performs