Skip to content

Instantly share code, notes, and snippets.

View b-murphy's full-sized avatar
😁

Brendan b-murphy

😁
  • Product Story
  • London, England
View GitHub Profile
$('#someSpecialLinkToBasket').on('click', function(e) {
fbq('track', 'InitiateCheckout', {
basket_value: 1000,
});
});
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},
@b-murphy
b-murphy / ummm.rb
Last active December 28, 2015 13:29
Need help with this.... there must be a better way.....
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"
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"
@b-murphy
b-murphy / artwork.rb
Created April 21, 2013 20:03
for lewis.
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"
@b-murphy
b-murphy / .bash_profile
Created February 25, 2013 11:03
bash profile.
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"
require 'virtus'
class Authenticator
# Required for Errors & Messages
##########################################
include Virtus
extend ActiveModel::Naming
include ActiveModel::Conversion
include ActiveModel::Validations
require './lib/enthuse/social_network_mappings'
require 'virtus'
class Authenticator
# Required for Errors & Messages
##########################################
include Virtus
extend ActiveModel::Naming
include ActiveModel::Conversion
include ActiveModel::Validations
# create the template
template = PageOfflineTemplate.new
template.quote = quote
template.pages = quote.build_pages
# Here I render a template with layout to a string then a PDF
pdf = PDFKit.new template.render_to_string(:template=>"quotes/review.html.haml")
# what's the expectation for the require within constant (non global state)
# like this?
require "mary.rb"
Bob = Module.new {}