Skip to content

Instantly share code, notes, and snippets.

16:48:41 admin:~
ubuntu:-> sudo dokku ps:rebuild production
-----> Cleaning up...
-----> Building production from buildstep...
-----> Adding BUILD_ENV to build environment...
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.1.8
-----> Installing dependencies using 1.7.12
//
// Grid Columns
//
// A mixin to help make Foundation's grid-column mixin easier
// to use when specifying multiple media quries/screen sizes
@mixin grid-columns(
// Mobile First Media Queries
$small-up-screens: false,
$medium-up-screens: false,
@diabolo
diabolo / aplay -l
Last active September 14, 2015 21:37
Disconnect issue with USB Audio - xHCI xhci_drop_endpoint called with disabled ep ffff88042763d280
**** List of PLAYBACK Hardware Devices ****
card 0: PCM2702 [Burr-Brown Japan PCM2702], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0
@diabolo
diabolo / gist:7223268
Created October 29, 2013 21:49
Rails query question
Reasonably complex query using ActiveRecord
I have the following tables
Agents
------
id name
Clients
-------
@diabolo
diabolo / stacktrace.md
Created August 7, 2013 12:40
Stack trace showing how Cucumber loads multi_json
Users/andy/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/json/common.rb:155:in `parse': uninitialized constant JSON::Parser (NameError)
    from /Users/andy/.rvm/gems/ruby-2.0.0-p247@global/gems/multi_json-1.7.8/lib/multi_json/adapters/json_common.rb:16:in `load'
    from /Users/andy/.rvm/gems/ruby-2.0.0-p247@global/gems/multi_json-1.7.8/lib/multi_json/adapter.rb:19:in `load'
    from /Users/andy/.rvm/gems/ruby-2.0.0-p247@global/gems/multi_json-1.7.8/lib/multi_json.rb:118:in `load'
    from /Users/andy/.rvm/gems/ruby-2.0.0-p247@h2/gems/gherkin-2.12.0/lib/gherkin/i18n.rb:14:in `<class:I18n>'
    from /Users/andy/.rvm/gems/ruby-2.0.0-p247@h2/gems/gherkin-2.12.0/lib/gherkin/i18n.rb:6:in `<module:Gherkin>'
    from /Users/andy/.rvm/gems/ruby-2.0.0-p247@h2/gems/gherkin-2.12.0/lib/gherkin/i18n.rb:5:in `<top (required)>'
    from /Users/andy/.rvm/gems/ruby-2.0.0-p247@h2/gems/gherkin-2.12.0/lib/gherkin/lexer/i18n_lexer.rb:2:in `require'

from /Users/andy/.rvm/gems/ruby-2.0.0-p247@h

@diabolo
diabolo / 01-domain_trip.rb
Created November 16, 2012 14:00 — forked from krisleech/01-domain_trip.rb
domain and persistence
class Domain::Trip
include Virtus
include ActiveModel::Validations
include ActiveModel::Conversion
extend ActiveModel::Naming
attribute :id
attribute :name
attribute :sections, Array[Section], :default => []
@diabolo
diabolo / debug_steps.rb
Created September 13, 2012 08:40
Cucumber step helper that uses coderay to peek at html.
require 'coderay'
module DebugStepHelper
def peek
output = CodeRay.scan(page.body, :html).term
print '-- peeking at body'
@diabolo
diabolo / bad_step_def.rb
Created July 13, 2012 05:00
Don't use variables in step_defs
require 'rubygems'
require 'mechanize'
require 'json'
module ApiExtensions
@agent = Mechanize.new
@api_header = {'Accept' => 'application/json', 'Content-Type' => 'application/json'}
@api_uris = {
'the list of campuses' => 'http://example.com/servicehosts/campus.svc',
@diabolo
diabolo / bdd.vim
Created December 4, 2011 13:01
Run RSpec and Cucumber from vim, on the current spec/feature
" Vim functions to run RSpec and Cucumber on the current file and optionally on
" the spec/scenario under the cursor.
function! RailsScriptIfExists(name)
" Bundle exec
if isdirectory(".bundle") || (exists("b:rails_root") && isdirectory(b:rails_root . "/.bundle"))
return "bundle exec " . a:name
" System Binary
else
return a:name
@diabolo
diabolo / Gemfile
Created June 27, 2011 17:22
Spork Cucumber Fail
source 'http://rubygems.org'
gem 'rails', '3.1.0.rc4'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2'
# Asset template engines