Skip to content

Instantly share code, notes, and snippets.

View trotter's full-sized avatar

Trotter Cashion trotter

View GitHub Profile
@trotter
trotter / cloudwatch_test.rb
Last active December 17, 2015 02:19 — forked from l1x/cloudwatch_test.rb
Using region as it works for me.
require 'pp'
require 'aws-sdk'
require 'logger'
module RAWS
class Metrics
def initialize
config_path = '.riotaws.yml'
AWS.config({
:access_key_id => 'A...',
bob = "pizza"
if false
puts bob
else bob = "dog"
puts bob
end
puts "done"
@trotter
trotter / Gemfile
Created April 27, 2012 00:46
Sinatra CF app
source :rubygems
gem 'sinatra'
gem 'thor'
gem 'mongo'
gem 'json'
Listen 192.168.1.1:443
LoadModule ssl_module modules/mod_ssl.so
SSLPassPhraseDialog builtin
AcceptMutex flock
SSLSessionCache shmcb:/var/cache/httpd/mod_ssl/ssl_scache(512000)
SSLSessionCacheTimeout 300
SSLMutex default
SSLRandomSeed startup /dev/urandom 256
post '/updates' do
uri = URI.parse("http://localhost:8901/send")
Net::HTTP.post_form(uri,
{ "data" => "Hello room!", "channel" => "chat-room-5"})
"ok"
end
chloe.connect(function () {
chloe.subscribe('chat-room-5', function (message) {
$("#messages").prepend("<li>" + message + "</li>")
});
});
@trotter
trotter / gist:1022900
Created June 13, 2011 14:50
yaws error log
=ERROR REPORT==== 13-Jun-2011::14:49:44 ===
Yaws process died: {noproc,
{gen_server,call,
[yaws_sendfile,
{send,40,
<<0,0,0,0,0,0,0,0,0,0,0,0,0,0,66,62,0,0,0,40,
47,104,111,109,101,47,117,98,117,110,116,
117,47,99,104,108,111,101,47,114,101,108,47,
99,104,108,111,101,45,48,46,48,46,51,98,101,
116,97,47,112,117,98,108,105,99,47,99,104,
@trotter
trotter / basic.erl
Created May 22, 2011 16:01
Philly Lambda Erlang/OTP Talk
-module(basic).
-export([say_hello/0,
make_hello/0,
match_me/1
]).
say_hello() ->
io:fwrite("Ohai!\n").
make_hello() ->
@trotter
trotter / gist:968560
Created May 12, 2011 14:06
spec fails
(in /Users/trotter/code/my-open-source/newflow)
......................................FFFFFFF
1)
'A workflow A workflow with no states should raise an error on creation' FAILED
expected Newflow::InvalidStateDefinitionError, got #<ArgumentError: wrong number of arguments (1 for 0)>
spec/newflow_workflow_spec.rb:17:in `block (3 levels) in <top (required)>'
2)
'A workflow A workflow with one state should raise an error on creation' FAILED
This is how ruby does things
ruby-1.9.2-p180 :007 > def variables(stuff)
ruby-1.9.2-p180 :008?> puts stuff
ruby-1.9.2-p180 :009?> end
=> nil
ruby-1.9.2-p180 :010 > variables(:hi => "there")
{:hi=>"there"}
=> nil
ruby-1.9.2-p180 :011 > variables (:hi => "there")