Skip to content

Instantly share code, notes, and snippets.

AWS::SES | topic lifecycle tests (aws, sns)
Expected(200) <=> Actual(400 Bad Request)
request => {:chunk_size=>1048576, :connect_timeout=>60, :debug_request=>true, :debug_response=>true, :headers=>{"User-Agent"=>"fog/1.15.0", "Content-Type"=>"application/x-www-form-urlencoded", "Host"=>"sqs.us-east-1.amazonaws.com:443"}, :idempotent=>nil, :instrumentor_name=>"excon", :middlewares=>[Excon::Middleware::ResponseParser, Excon::Middleware::Expects, Excon::Middleware::Idempotent, Excon::Middleware::Instrumentor, Excon::Middleware::Mock], :mock=>true, :nonblock=>true, :omit_default_port=>false, :read_timeout=>60, :retry_limit=>4, :ssl_verify_peer=>true, :tcp_nodelay=>false, :uri_parser=>URI, :write_timeout=>60, :host=>"sqs.us-east-1.amazonaws.com", :path=>"/065873908207/fog_subscription_tests", :port=>"443", :query=>nil, :scheme=>"https", :user=>nil, :password=>nil, :__construction_args=>{:host=>"sqs.us-east-1.amazonaws.com", :path=>"/", :port=>"443", :query=>nil, :scheme=>"https", :user=>nil, :password=>nil,
class Table
constructor: (@rows, @columns)->
toHtml: ->
@el 'table', (@createRow() for row in [0...@rows]).join('')
createRow: ->
@el 'tr', (@createCell() for cell in [0...@columns]).join('')
createCell: ->
# __git_ps1 accepts 0 or 1 arguments (i.e., format string)
# returns text to add to bash PS1 prompt (includes branch name)
__git_ps1 ()
{
local g="$(__gitdir)"
if [ -n "$g" ]; then
local r=""
local b=""
if [ -f "$g/rebase-merge/interactive" ]; then
r="|REBASE-i"
@gvarela
gvarela / principleofcompletesurprise.coffee
Created May 31, 2012 21:44
principleofcompletesurprise.coffee
class MyButton
constructor: () ->
#do stuff....
@buildElement()
return @element # <-- never ever do this
build: ->
@gvarela
gvarela / bindable.coffee
Created February 7, 2012 22:50
Light weight DI for client side components in CoffeScript..
class window.Bindable
constructor: (context=$('body'), @dataKey='bindable')->
@bindables = $("[data-#{@dataKey}]", context)
@instanceKey = "#{@dataKey}-instance"
bindAll: ->
@bind(el) for el in @bindables
Then /^the following fields should be required:$/ do |fields|
fields.rows_hash.each do |field, custom_message|
node = find('input[type="submit"]', :message => "Unable to locate the submit button to click on")
node.click
Then %{the "#{field}" field should have the error "#{custom_message.presence || "can't be blank"}"}
end
end
@gvarela
gvarela / spork
Created August 4, 2011 17:45
manage spork easily
#!/usr/bin/env bash
if [ $@ == 'start' ]
then
bundle exec spork &
rspec_pid=$!
bundle exec spork cucumber &
cuke_pid=$!
echo "$rspec_pid $cuke_pid" > tmp/spork.pids
exit
@gvarela
gvarela / Gemfile
Created May 5, 2011 16:30
web sockets with eventmachine and redis pub/sub
# A sample Gemfile
source "http://rubygems.org"
gem "redis"
gem 'eventmachine', :git => 'git://github.com/eventmachine/eventmachine.git'
gem "em-hiredis"
# gem "em-synchrony"
gem "em-websocket"
@gvarela
gvarela / nginx.conf
Created April 19, 2011 16:05
ssl proxy with nginx
server {
listen 443 ssl;
server_name sg-wholesale.dev;
ssl on;
ssl_certificate ssl/sg-wholesale.dev.crt;
ssl_certificate_key ssl/sg-wholesale.dev.key;
keepalive_timeout 60;
# include gems
gem 'pg'
gem 'haml-rails'
gem 'jquery-rails'
gem 'has_scope'
gem 'will_paginate'
gem 'simple_form'
gem 'utensils', github: 'modeset/utensils'
gem 'unicorn'