Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am adamcarlile on github.
  • I am adamcarlile (https://keybase.io/adamcarlile) on keybase.
  • I have a public key ASBkVmMunv_EHnINy5nyPsm6vNuwUfjc_e30rsYJr87TQgo

To claim this, I am signing this object:

require 'faraday'
conn = Faraday.new(url: 'https://www.crowdcube.com') do |faraday|
faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
end
success = false
until success
begin
response = conn.get('/investment/mondo-20857')
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="eastwood"
# Example aliases
  • When you have no images loaded into your account, showing the search functionality is confusing (hide)
  • Form Submission Feedback: Entity settings Save feedback: If you click the Save button and something is invalid, it's confusing not to be prevented with feedback near to the save button explaining why you cannot Save (especially if the invalid element is off the screen)
  • Fields that shouldn't be required
  • Events: Pice & Ticket Url
  • Product: Summary, Description & Tags
  • ensure form scrolls down to display the new error message

This game requires a decent group of people at a party, maybe 6-10, and a case or two (read: five). Also, duct tape.

Start of the night by explaining the game in it's entirety, while everyone is cracking their first beer or so. Get everyone in on it, more fun that way.

The idea of the game is to drink beer, and level up your Wizardly skills. Once you finish a beer, you get a new beer, and tape it to the top of the old can. This puts you at level 2 (2 cans). Drink that beer, get new beer, tape to top of old beer can, welcome to level 2. You get the idea. In case you haven't figured it out by now, you are constructing a staff.

Your staff is an indicator of your level of Wizardry and intoxication. It also brings me to the most entertaining part of the game- spells. More spells are unlocked by being a higher level, and they typically will cost cans to cast. Here's a list of spells, but feel free to fuck with these.

  1. No spells at level one you little bitch, just drink your damn beer.
  2. Can to the Face - Cal
@adamcarlile
adamcarlile / hash.rb
Created April 24, 2012 13:48
Hash extensions for dealing with Microsoft CamelCase XML returned by their web services eg(http://cloud.tfl.gov.uk/TrackerNet/LineStatus)
require 'active_support/core_ext'
class Hash
def rubyfy_keys!
keys.each do |key|
self[(key.underscore rescue key) || key] = delete(key)
end
self
end
heroku addons:add deployhooks:http url="http://airbrake.io/deploys.txt?deploy[rails_env]=YOUR_ENVIRONMENT&api_key=YOUR_API_KEY&deploy[local_username]={{user}}&deploy[scm_repository]=git@github.com:youruser/your-repo.git&deploy[scm_revision]={{head}}" --app heroku_app_name
@adamcarlile
adamcarlile / extra_fields.rb
Created October 31, 2011 21:22
Serialized hash, accessors as methods
module ExtraFields
def self.included(base)
base.serialized_fields.each do |method_name|
base.class_eval <<-EOS
def #{method_name.to_s}
extra_fields[:#{method_name}] if extra_fields && extra_fields[:#{method_name}]
end
def #{method_name.to_s}=(value)
self.extra_fields[:#{method_name}] = value
@adamcarlile
adamcarlile / render_user_status_bad.rb
Created March 12, 2011 03:57
Render user status examples
def render_user_status
if user_signed_in?
inner_html = content_tag(:span, "Signed in as #{current_user.email}. Not you? \n #{link_to("Sign out", destroy_user_session_path)}")
else
inner_html = content_tag(:span, "#{link_to("Sign up", new_user_registration_path)} \n or \n #{link_to("Sign in", new_user_session_path)}")
end
return content_tag(:div, inner_html, :id => "user_nav")
end
module GravatarHelper
def gravatize(email, options={})
default_options = {:size => 60}
options = default_options.update(options)
crypted_email = Digest::MD5.hexdigest(email)
output = "http://www.gravatar.com/avatar/#{crypted_email}?s=#{options[:size]}"
return image_tag(output)
end