Skip to content

Instantly share code, notes, and snippets.

View dangerousbeans's full-sized avatar

Joran Kikke dangerousbeans

View GitHub Profile
@dangerousbeans
dangerousbeans / gist:1319104
Created October 27, 2011 09:03
Config bundle to install with a specific pg_config
bundle config build.pg --with-pg-config=/path/to/pg_config
@dangerousbeans
dangerousbeans / knife_usage.sh
Created November 22, 2011 09:52
Knife Commands
# Inside a git repo
# install the git cookbook
knife cookbook site install git
# upload all cookbooks onto the git-repos configured hosted chef account
knife cookbook upload -a
@dangerousbeans
dangerousbeans / example_have_selector_rspec.rb
Created December 7, 2011 10:53
An example of using the have_selector in rspec2
it "displays recently viewed destination for each viewed destination" do
get :show, :id => @destination
rendered.should have_selector('img.hotel_image', :count => 2)
end
@dangerousbeans
dangerousbeans / gist:2029210
Created March 13, 2012 14:46
Ubuntu rails server setup steps
Environment
1. Create user for app
useradd -m -s /bin/bash user_name
passwd user_name
2. Add to sudo group
usermod -a -G sudo user_name
Security
1. Setup ssh keys
@dangerousbeans
dangerousbeans / twittergetter.rb
Created June 4, 2012 12:39
How to get twitter account from user account number on linkedin
require 'oauth'
require 'json'
CONSUMER_KEY = "your-linkedin-app-key"
CONSUMER_SECRET = "secret-linkedin-app-thing"
consumer_options = {}
oauth_token = "derp-derp-derp-hex" # Your oauth key in hex
oauth_secret = "derp-derp-derp-more-hex" # your oauth secret key thing
@dangerousbeans
dangerousbeans / rabbitmq_crazy
Created June 12, 2012 16:03
RabbitMQ Control
sudo rabbitmqctl delete_vhost /
sudo rabbitmqctl create_vhost /
sudo rabbitmqctl set_permissions -p / guest '.*' '.*' '.*'
@dangerousbeans
dangerousbeans / gist:4217073
Created December 5, 2012 16:19
Example of train call
http://ingeniapi.com/train?auth_token=<API KEY>&api_version=1.0&text=text to train&tag_sets={"Type":["University","Exam"],"Topics":["Software"],"Keywords":["Distinction","Completing"]}
@dangerousbeans
dangerousbeans / fontdeckspeed.sh
Created January 16, 2013 14:31
f.fontdeck speed
⚡ $ curl -O http://f.fontdeck.com/s/css/3nQ4Zt9uZHi/fSeMr4rODjmORk4/localhost/21367.css [14:25:32]
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1700 100 1700 0 0 94 0 0:00:18 0:00:17 0:00:01 84
100 1700 100 1700 0 0 4611 0 --:--:-- --:--:-- --:--:-- 415k
100 1700 100 1700 0 0 157k 0 --:--:-- --:--:-- --:--:-- 332k
100 1700 100 1700 0 0 145k 0 --:--:-- --:--:-- --:--:-- 415k
100 1700 100 1700 0 0 114 0 0:00:14 0:00:14 --:--:-- 87
@dangerousbeans
dangerousbeans / gist:4663355
Created January 29, 2013 10:33
Problems with rubygem dependencies
curl http://rubygems.org/api/v1/dependencies\?gems\=tenderlove-frex,spicycode-rcov
@dangerousbeans
dangerousbeans / gist:4677641
Last active December 11, 2015 23:38
RESET ALL THE COUNTERS
Technology.find_each do |tech| Technology.reset_counters(tech.id, :patents) end