Skip to content

Instantly share code, notes, and snippets.

View phil-monroe's full-sized avatar

Phil Monroe phil-monroe

View GitHub Profile
TypeError: Cannot read property 'heroku__app' of undefined
at /bundles/kibana.bundle.js?v=9910:92503
at baseFindIndex (/bundles/commons.bundle.js?v=9910:5797)
at Function.<anonymous> (/bundles/commons.bundle.js?v=9910:8712)
at /bundles/kibana.bundle.js?v=9910:92495
at arrayEach (/bundles/commons.bundle.js?v=9910:6760)
at Function.<anonymous> (/bundles/commons.bundle.js?v=9910:8816)
at Object.filterManager.add (/bundles/kibana.bundle.js?v=9910:92493)
at Scope.$scope.filterQuery [as updateFilterInQuery] (/bundles/kibana.bundle.js?v=9910:22553)
at fn (eval at compile (/bundles/commons.bundle.js?v=9910:40962), <anonymous>:4:529)
@phil-monroe
phil-monroe / versioned_mailer_example.rb
Created April 17, 2016 00:22
Example of how to use mailer versioning in Lale.help
class UserMailer < BaseMandrillMailer
# Template in mandrill: ":lang/user/forgot_password/v2"
def forgot_password(user, token)
build_message(user.language, user.email, version: 2) do
# ^ note the named parameter "version"
# Merge Vars...
end
end
@phil-monroe
phil-monroe / example_presenter.rb
Created February 2, 2016 03:35
My attempt at a presenter and page objects for Rails
class TestPresenter < Presenter
let(:a) { 5 }
let(:b) { 3 }
let(:c) { a * b }
let(:str) { _.to_s }
let(:sym) { _.to_sym }
let(:to_yaml)
end
# 0) do only if you done have the code
git clone REPO_URL
# 1) pull latest master
git checkout master
git pull origin master
# 2) create new branch.
git checkout -b feature/foobar
@phil-monroe
phil-monroe / SassMeister-input-HTML.haml
Created October 20, 2015 00:39
Generated by SassMeister.com.
%header
.name
The is the name
.actions
These are actions
.print-only
Only in Print
@phil-monroe
phil-monroe / SassMeister-input-HTML.haml
Created October 20, 2015 00:33
Generated by SassMeister.com.
%header
.name
The is the name
.actions
These are actions
.print-only
Only in Print
docker% make docs
/Library/Developer/CommandLineTools/usr/bin/make -C docs docs
docker build -t "docs-base:15058-include-name-in-syslog-tag" .
Sending build context to Docker daemon 7.074 MB
Sending build context to Docker daemon
Step 0 : FROM docs/base:latest
---> 1621828e3ad8
Step 1 : MAINTAINER Mary Anthony <mary@docker.com> (@moxiegirl)
---> Using cache
---> f131e0f60e41
@phil-monroe
phil-monroe / move_invites.script
Created July 13, 2015 18:30
AppleScript to move calendar invites to a folder for OS X Mail
using terms from application "Mail"
on perform mail action with messages theSelectedMessages for rule theRule
repeat with theMessageNum from 1 to count theSelectedMessages
set theMessage to theSelectedMessages's item theMessageNum
if theMessage's source contains "Content-Type: text/calendar" then
set mailbox of theMessage to mailbox "Calendar Invites" of account "my_account"
end if
end repeat
end perform mail action with messages
end using terms from
@phil-monroe
phil-monroe / update_states.rb
Created October 7, 2014 18:27
A simple way to transform and AR state column into a standardized iso code-ish format
MAPPINGS = {
# format: "COMMON MISTAKE" => "DESIRED STATE SYMBOL"
"OHIO" => "OH",
"CALI" => "CA",
"CALIFORNIA" => "CA"
# and so on...
}
STATES = MAPPINGS.values.uniq # or possibly explicitly defined: %w(OH, CA, ...)
@phil-monroe
phil-monroe / audio.rb
Created February 19, 2014 14:48
Use CoreAudio with Ruby to make a real time CLI level meter and frequency response chart
require "thread"
require "fftw3"
require "coreaudio"
require 'ruby-progressbar'
# progressbar = ProgressBar.create
# progressbar.total = 100
Thread.abort_on_exception = true