Skip to content

Instantly share code, notes, and snippets.

View coffeencoke's full-sized avatar

Matt Simpson coffeencoke

View GitHub Profile
@coffeencoke
coffeencoke / gist:2721066
Created May 17, 2012 19:18
Use capistrano to symlink you shared files, don't build a wheel inside of the car while you're driving the car
# WHY? Capistrano has already made this super easy for us to do, AND,
# capistrano is already doing this for us for pids, log, and system files.
desc "Create socket file symlink for nginx"
task :symlink_sockets, :except => {:no_release => true} do
run "mkdir -p #{shared_path}/sockets"
run "ln -s #{shared_path}/sockets #{release_path}/tmp/sockets"
end
# utilize that capistrano has already done this!
#
@coffeencoke
coffeencoke / agile_cycle.md
Created February 23, 2012 22:21
Agile Cycle List

Agile Cycle

Example "to get started" way to read this:

To begin our process, we start at the planning cycle, do we need stories? if not, go to the Development Cycle. If we do need stories, write stories. If the story is a web story and it needs markup, add to the need markup queue, if it does not need markup, add to the ready to be coded queue. If the story is not a web story but is a mobile support story, and the story needs requirements from the mobile team, add to the need requirements queue. If it does not need requirements, add to the ready to be coded for mobile support queue…

Planning

  • Need Stories
    • Write Stories
  • Web Story
@coffeencoke
coffeencoke / image.html
Created February 22, 2012 13:45
Prevent saving images for copyright purposes
<img class='portfolio' oncontextmenu="return false" ondragstart="return false" src='copyrighted_image.png' />
@coffeencoke
coffeencoke / gist:1718055
Created February 1, 2012 17:03
Session clears when making ajax requests in Rails 3.0.4+
$.ajaxSetup({
beforeSend: function(xhr) {
xhr.setRequestHeader('X-CSRF-Token', $("meta[name='csrf-token']").attr('content'));
}}
);
@coffeencoke
coffeencoke / gist:1597151
Created January 11, 2012 22:26
How to? default hash paramater being given as nil
class Something
def initialize(hash={})
hash ||= {} # Do not want to do this!
@my_attribute = hash[:my_attribute]
end
end
Something.new(nil) # nil param happens with forms occasionally
Something.new({})
Something.new(:my_attribute => 'something')
@coffeencoke
coffeencoke / xcode_breaks_gcc
Created December 20, 2011 03:31
Fix some issues with Xcode 4.2.1 and OS X Lion
sudo rm /usr/bin/gnumake /usr/bin/gcc /usr/bin/g++
sudo ln -s /Developer/usr/bin/gnumake /usr/bin/
sudo ln -s /Developer/usr/bin/gcc /usr/bin/
sudo ln -s /Developer/usr/bin/g++ /usr/bin/
@coffeencoke
coffeencoke / group_of_thingies.rb
Created December 1, 2011 01:30
Test a block in Ruby
class GroupOfThingies
attr_accessor :thingies
# Use like this:
#
# group_of_thingies = GroupOfThingies.new
# group_of_thingies.each do |thing|
# puts "Check out this awesome thing: #{thing}!"
# end
#
# PUT /buckets/Animals
# PUT /buckets/Animals.json
# Used for creating and updating buckets
# view the features located at /features/buckets.*.feature
# for details on the design of this method.
def update
@bucket = Bucket.find_or_new_by_name params[:id]
if @bucket.new_record?
if @bucket.save
respond_to do |format|
Firebug Put Data:
_method: put
did_master_entry[active]: false
did_master_entry[client_id]:
did_master_entry[custom_options][][custom_attribute][value]: 6367364000
did_master_entry[custom_options][][id]: 1
did_master_entry[custom_options][][custom_attribute][value]: Test DNIS Name
did_master_entry[custom_options][][id]: 2
did_master_entry[custom_options][][custom_attribute][value]: