Skip to content

Instantly share code, notes, and snippets.

@septerr
septerr / gist:67813c261ab24a2ba51996699b1b9a33
Created May 28, 2017 05:03
Ether Wallet Test Network PK
0x86746FbeFF0E5f13C4D03436feEFEc26dc82b85F
@septerr
septerr / rvmWorkflow
Created October 3, 2014 02:14
RVM Workflow
1. first install the ruby you want to use, say 1.9.3 (rvm install 1.9.3)
2. create gemset for project, say proj (rvm gemset create proj)
3. then say 'rvm 1.9.3@proj'. this will cause rvm to use the specified ruby version and the specified gemset hereon
4. now install the rails version you want to use in this project: 'gem install rails -v 3.2.14' will install rails 3.2.14 in the proj gemset
5. now you can create your project with rails new...
6. After the project is created, from the project directory run:
7. rvm --ruby-version use 1.9.3@proj This will add .ruby-version and .ruby-gemset files to the project and make sure that anytime you switch to this project directory, the correct ruby version and gemset are used.
8. To find where rubies and gems for the current gemset are installed do: rvm info
@septerr
septerr / Rails Base64 encoded HMAC-SHA1
Last active June 17, 2016 06:31
Base64 encoded HMAC-SHA1 in iOS and Rails
secret = "xxx"
data = "http://someurl?someparams"
hmac = OpenSSL::HMAC.digest(OpenSSL::Digest::Digest.new('sha1'), secret.encode("ASCII"), data.encode("ASCII"))
signature = Base64.encode64(hmac).chomp
@septerr
septerr / application.rb
Created July 19, 2012 20:53
locomotive_app_customization
require File.expand_path('../boot', __FILE__)
# Pick the frameworks you want:
# require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
require "sprockets/railtie"
require "rails/test_unit/railtie"
@septerr
septerr / locomotive_home_inline_edit
Created June 10, 2012 06:13
locomotive_home_inline_edit
!!! 5
%html{:lang => "en"}
%head
%meta{:charset => "utf-8"}
%title {{ site.name }}
%meta{:content => "", :name => "description"}
%meta{:content => "", :name => "author"}
@septerr
septerr / prod_env_errors
Created June 1, 2012 20:54
heroku locomotivecms prod errors
MONGOHQ_URL='mongodb://heroku:[email protected]:10016/app4941383' RAILS_ENV=production rails console
...loading heroku extension
/Users/sony/.rvm/gems/ruby-1.9.3-p194/gems/excon-0.13.4/lib/excon/connection.rb:266:in `request_kernel': Expected(200) <=> Actual(404 Not Found) (Heroku::API::Errors::NotFound)
request => {:connect_timeout=>60, :headers=>{"Accept"=>"application/json", "Accept-Encoding"=>"gzip", "Authorization"=>"Basic OmNjYzY1ZmMyNTFkODY1MmQ2NWJhOWVkMTA1MjJjM2E2NTc4NmRiNzM=", "User-Agent"=>"heroku-rb/0.1.8", "X-Heroku-API-Version"=>"3", "X-Ruby-Version"=>"1.9.3", "X-Ruby-Platform"=>"x86_64-darwin11.3.0", "Host"=>"api.heroku.com:443"}, :instrumentor_name=>"excon", :mock=>false, :read_timeout=>60, :retry_limit=>4, :ssl_ca_file=>"/Users/sony/.rvm/gems/ruby-1.9.3-p194/gems/excon-0.13.4/data/cacert.pem", :ssl_verify_peer=>true, :write_timeout=>60, :host=>"api.heroku.com", :path=>"/apps/homeschool_minder/domains", :port=>"443", :query=>nil, :scheme=>"https", :expects=>2