Skip to content

Instantly share code, notes, and snippets.

View cmhobbs's full-sized avatar
🍩
Waiting between the walls.

Christopher M. Hobbs cmhobbs

🍩
Waiting between the walls.
View GitHub Profile
%hr
%fieldset
.control-group
= label_tag :invite_code, nil, :class => "control-label"
.controls
= text_field_tag :invite_code
.control-group
[09:40][chris@bmo:~/dev/hackumen/mail-dancer(master*)]$ llllllllllllllllllhhhhhhhhhhhhhFUCK
# client setup
def initialize
nconf = YAML.load_file("config/netsuite.yml")
@client = Netsuite::Client.new(nconf['account'], nconf['email'], nconf['password'], nconf['role'])
@search_id = nconf['search_id']
end
# method in question
def fetch_delayed_pos
@cmhobbs
cmhobbs / 1.9.3
Created September 26, 2012 15:09
10:09:01 resque.1 | == DEBUG profiler stats for EtJob#perform
10:09:01 resque.1 | GC 29 invokes.
10:09:01 resque.1 | Index Invoke Time(sec) Use Size(byte) Total Size(byte) Total Object GC Time(ms)
10:09:01 resque.1 | 1 -0.001 1791680 4057280 101432 10.23500000000000120792
[2012-09-25 23:40:21] ./configure --prefix="/Users/chris/.rvm/usr"
sed: Command garbled: /^.*\/\([^/][^/]*\)\/*$/{
sed: Command garbled: /^.*\/\([^/][^/]*\)\/*$/{
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... config/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
@cmhobbs
cmhobbs / uploader.go
Created August 3, 2012 04:21
Handling multipart file uploads with goweb
package main
import (
"code.google.com/p/goweb/goweb"
"io/ioutil"
)
// dummy error struct for pretty json export
type ControllerError struct {
Error error
@cmhobbs
cmhobbs / gist:3230713
Created August 1, 2012 21:03
Dump out the raw request of a query in Go
/*
cx is a goweb Context struct
cx.Request is just a net/http Request struct
*/
raw_query := cx.Request.URL.RawQuery
parsed, _ := url.ParseQuery(raw_query)
cx.RespondWithData(parsed["payload"][0]) // grab a single field of parsed
require 'fssm'
DIR = %x{pwd}.strip
puts "! WATCHER INITIALIZED"
FSSM.monitor(DIR) do
update do |path, file|
puts "! FILE MODIFIED - #{path}/#{file}"
end
require 'em-dir-watcher'
DIR = %x{pwd}.strip
EM.run {
dw = EMDirWatcher.watch DIR do |paths|
paths.each do |file|
if File.exists? file
puts "! FILE MODIFIED #{file}"
else
[15:13][christopher@ryleh:~/dev/sinatra-bones(master+*)]$ gem install sorcery
ERROR: Error installing sorcery:
sorcery requires sorcery (>= 0)