Skip to content

Instantly share code, notes, and snippets.

View myitcv's full-sized avatar

Paul Jolly myitcv

View GitHub Profile
@myitcv
myitcv / instructions.sh
Last active August 29, 2015 13:56
New go env
gvm install go1.2
gvm pkgenv # to add $HOME/gostuff to GOPATH
# add to to end of .bashrc
gvm use go1.2 > /dev/null 2>&1
export PATH="${GOPATH//://bin:}/bin:$PATH"
# restart bash
exec bash
@myitcv
myitcv / time_travel_trigger.sql
Last active March 8, 2022 06:50
Trigger-based equivalent of old PostgreSQL time travel module - see https://blog.myitcv.io/2014/02/25/row-level-version-control-with-postgresql.html for more details
/*
Copyright (c) 2015 Paul Jolly <[email protected])
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
\dx
-- See what extensions are loaded
create extension timetravel;
-- load the timetravel extension
-- after installing the latest version
@myitcv
myitcv / v2.rb
Created February 19, 2014 16:28
require 'rubygems'
require 'bundler/setup'
require 'celluloid/autostart'
require 'aws-sdk-core'
Aws.config = { access_key_id: 'xxxxxxxx', secret_access_key: 'xxxxxxxxxxx', region: 'xxxxxxxxxxxxx' }
class SigningTest
include Celluloid
source "https://rubygems.org"
gem 'celluloid', github: 'celluloid/celluloid'
gem 'aws-sdk-core'
gem 'rubysl', platform: :rbx
@myitcv
myitcv / v1.rb
Last active August 29, 2015 13:56
require 'rubygems'
require 'bundler/setup'
require 'celluloid/autostart'
require 'aws-sdk-core'
Aws.config = { access_key_id: 'xxxxxxxxx', secret_access_key: 'xxxxxxxxxxx', region: 'xxxxxxxxx' }
class SigningTest
include Celluloid
@myitcv
myitcv / v3.rb
Last active August 29, 2015 13:56
require 'rubygems'
require 'bundler/setup'
require 'celluloid/autostart'
require 'aws-sdk-core'
Aws.config = { access_key_id: 'xxxxxxxxx', secret_access_key: 'xxxxxxxxxxxx', region: 'xxxxxxxxx' }
class SigningTest
include Celluloid
Aws::DynamoDB::Errors::InvalidSignatureException: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
The Canonical String for this request should have been
'POST
/
content-type:application/x-amz-json-1.0
host:dynamodb.us-east-1.amazonaws.com
user-agent:aws-sdk-ruby2/2.0.0.rc6 rbx/2.1.0 x86_64-linux-gnu Seahorse/0.1.0
x-amz-content-sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a
Rubinius::ObjectBoundsExceededError: Tuple::at_prim: index 16 out of bounds for size 16
kernel/common/hash.rb:462:in `redistribute'
kernel/common/hash.rb:193:in `__store__ ([]=)'
kernel/common/hash.rb:424:in `merge!'
kernel/common/hash.rb:330:in `each_item'
kernel/common/hash.rb:423:in `update (merge!)'
/home/myitcv/.rbenv/versions/rbx-2.2.5/gems/gems/aws-sdk-core-2.0.0.rc6/vendor/seahorse/lib/seahorse/model/node.rb:38:in `properties'
/home/myitcv/.rbenv/versions/rbx-2.2.5/gems/gems/aws-sdk-core-2.0.0.rc6/vendor/seahorse/lib/seahorse/model/node.rb:78:in `from_hash'
kernel/common/hash.rb:342:in `each'
/home/myitcv/.rbenv/versions/rbx-2.2.5/gems/gems/aws-sdk-core-2.0.0.rc6/vendor/seahorse/lib/seahorse/model/node.rb:75:in `from_hash'
RuntimeError: Unrecognized properties: type, serialized_name on {"type"=>"string", "serialized_name"=>"ExclusiveStartTableName"}
/home/myitcv/.rbenv/versions/rbx-2.2.5/gems/gems/aws-sdk-core-2.0.0.rc6/vendor/seahorse/lib/seahorse/model/node.rb:88:in `from_hash'
/home/myitcv/.rbenv/versions/rbx-2.2.5/gems/gems/aws-sdk-core-2.0.0.rc6/vendor/seahorse/lib/seahorse/model/shapes/shape.rb:107:in `from_hash'
kernel/common/enumerable.rb:293:in `inject'
kernel/common/hash.rb:342:in `each'
kernel/common/enumerable.rb:288:in `inject'
/home/myitcv/.rbenv/versions/rbx-2.2.5/gems/gems/aws-sdk-core-2.0.0.rc6/vendor/seahorse/lib/seahorse/model/shapes/shape.rb:107:in `from_hash'
/home/myitcv/.rbenv/versions/rbx-2.2.5/gems/gems/aws-sdk-core-2.0.0.rc6/vendor/seahorse/lib/seahorse/model/property.rb:122:in `deserialize'
/home/myitcv/.rbenv/versions/rbx-2.2.5/gems/gems/aws-sdk-core-2.0.0.rc6/vendor/seahorse/lib/seahorse/model/property.rb:52:in `load_from'
/home