Skip to content

Instantly share code, notes, and snippets.

View davidjrice's full-sized avatar

David Rice davidjrice

View GitHub Profile
@davidjrice
davidjrice / punctuation.js
Created April 30, 2014 22:16
List of punctuation characters
var PUNCTUATION = "" +
"’'" + // apostrophe
"()[]{}<>" + // brackets
":" + // colon
"," + // comma
"‒–—―" + // dashes
"…" + // ellipsis
"!" + // exclamation mark
"." + // full stop/period
"«»" + // guillemets
@davidjrice
davidjrice / gist:3d923a6920d80dad7b22
Created October 30, 2015 12:59 — forked from gwik/gist:6298001
Database setup and seeds for Rails, RSpec, Capybara, DatabaseCleaner and friends
# Database setup and seeds loading
# See the block post : http://sigkill.tumblr.com/post/58933579738/test-database-setup-and-seeds-with-rails-rspec
module Seeder
@@__cache__ = {}
def self.load_seed(filename, prefix='app')
filename = Rails.root + "db/seeds/#{prefix}/#{filename}.seeds.rb"
seed_mod = @@__cache__[filename] ||= begin
mod = Module.new
@davidjrice
davidjrice / redcarpet.rb
Created June 29, 2012 00:34
Rails 3.2 Markdown Template Handler
# config/initializers/redcarpet.rb
module ActionView
module Template::Handlers
class Markdown
class_attribute :default_format
self.default_format = Mime::HTML
def call(template)
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :autolink => true, :space_after_headers => true)
markdown.render(template.source).html_safe.inspect
@davidjrice
davidjrice / .travis.yml
Last active October 23, 2019 16:17 — forked from johanneswuerbach/.travis.yml
Travis CI + TestFlight integration (updated for Travis' new Mac VM setup / xctool)
language: objective-c
xcode_workspace: "<WorkspaceName.xcworkspace>"
xcode_scheme: "<SchemaName>"
script: xctool -workspace <WorkspaceName.xcworkspace> -scheme <SchemeName> -configuration Release build archive
before_script:
- ./scripts/travis/add-key.sh
after_script:
- ./scripts/travis/remove-key.sh
after_success:
- ./scripts/travis/testflight.sh
@davidjrice
davidjrice / instrumentation.rb
Created June 27, 2018 12:47 — forked from garrensmith/instrumentation.rb
CouchRest Instrumentation for Rails 3
# add to config/initializers/instrumentation.rb
module CouchRest
class Database
alias_method :old_get, :get
alias_method :old_view, :view
alias_method :old_update_doc, :update_doc
alias_method :old_delete_doc, :delete_doc
@davidjrice
davidjrice / README.md
Created June 14, 2012 21:53
New Relic Instrumentation for Couchbase Ruby
  • Install & Setup New Relic
  • cd my_rails_project/config/initializers
  • wget http://raw.github.com/gist/2933202/5adcf11839c0ef2064a5f0c6e0fe795d9ed2c60a/couchbase_new_relic_instrumentation.rb
  • git add and deploy as usual!

Couchbase New Relic Instrumentation

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install wget
wget https://dl-web.dropbox.com/installer\?build_no\=5.4.24\&plat\=mac -o DropboxInstaller.dmg
open DropboxInstaller.dmg
record.on "didLoad", $.proxy(->
console.log "loaded"
@doSomething()
), @
# Object #<Demo2> has no method 'apply'
prefix=/app/vendor/cairo-1.12.8
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: cairo-ft
Description: FreeType font backend for cairo graphics library
Version: 1.12.8
Requires: cairo freetype2 >= 9.7.3
prefix=/app/vendor/pixman-0.28.0
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: Pixman
Description: The pixman library (version 1)
Version: 0.28.0
Cflags: -I${includedir}
Libs: -L${libdir} -lpixman-1