This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#someSpecialLinkToBasket').on('click', function(e) { | |
fbq('track', 'InitiateCheckout', { | |
basket_value: 1000, | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule HelloPhoenix.Memcached.Supervisor do | |
use Supervisor | |
def start_link do | |
Supervisor.start_link(__MODULE__, []) | |
end | |
def init([]) do | |
pool_options = [ | |
name: {:local, :memcached_pool}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# what's the expectation for the require within constant (non global state) | |
# like this? | |
require "mary.rb" | |
Bob = Module.new {} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def self.find_or_next(id) | |
find(id) | |
rescue ActiveRecord::RecordNotFound | |
if (id == last.id + 1) then raise ActiveRecord::RecordNotFound; end | |
find(id+1) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get install docker.io | |
sudo ln -sf /usr/bin/docker.io /usr/local/bin/docker | |
curl -L https://github.com/orchardup/fig/releases/download/0.4.1/linux > /usr/local/bin/fig | |
chmod +x /usr/local/bin/fig |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ADF.SpaceImageUploadView = Ember.View.extend( | |
didInsertElement: -> | |
_this = this | |
this.$("input.image_uploader").on('click', -> | |
storePath = "/space/#{_this.get('controller.model.id')}/images/" | |
filepicker.pickAndStore({multiple: true, folders: true, mimetype: 'image/*', isWriteable: false}, {path: storePath, container: 'adoorfor'}, (data) -> | |
_.each(data, (rawData) -> | |
_this.resizeImage(rawData) | |
) | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pry' | |
RSpec.describe " example iterator " do | |
class ATest | |
def call(args = {}) | |
args[:a] = "this was at A" | |
args[:b] = "this should not happen" | |
args[:c] = "this should not happen" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PATH="/Users/brendanmurphy/bin:$PATH:." | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" | |
export PATH="/usr/local/bin:$PATH:/usr/local/bin" | |
export PATH="/usr/local/heroku/bin:$PATH" | |
# Enthuse | |
alias enthuse="cd ~/work/Enthuse" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rest_client' | |
require 'json' | |
class Artwork | |
def fetch(query) | |
api_key = '82a7531b6438492cd9e967442e5b12c8' | |
album = RestClient.get("http://ws.audioscrobbler.com/2.0/?method=album.search&album=#{query}&api_key=#{api_key}&format=json") | |
album = JSON.parse(album) | |
results = album.fetch('results').fetch('albummatches').fetch('album')[0].fetch('image').last.fetch('#text') | |
print results.to_s + "\n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PATH="/Users/brendanmurphy/bin:$PATH:." | |
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" | |
alias be="bundle exec" | |
alias rdb="bundle install; bundle exec rake db:drop; bundle exec rake db:create; bundle exec rake db:migrate; bundle exec rake db:test:prepare" | |
alias rdbi="rdb; import_backup; be rake db:migrate; be rake db:test:prepare" | |
# rails | |
alias rs="rails s" |
NewerOlder