Skip to content

Instantly share code, notes, and snippets.

Phil Monroe phil-monroe

Block or report user

Report or block phil-monroe

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View apify-browser-events.js
const crawler = new Apify.PuppeteerCrawler({
launchPuppeteerFunction: () => {
return Apify.launchPuppeteer({
// puppeteer config options
}).then((browser) => {
browser.on('disconnected', console.log)
browser.on('targetchanged', console.log)
browser.on('targetcreated ', console.log)
browser.on('targetdestroyed', console.log)
return browser
phil-monroe / oauth_controller.rb
Created Jun 27, 2019
Authenticate Active Admin + Sidekiq w/ OmniAuth (Google)
View oauth_controller.rb
class Admin::OauthController < ApplicationController
def self.authenticated?(request)
session = request.session
session[:email].present? && session[:authenticated_at].present? && ([:authenticated_at]) + 24.hours).future?
def self.current_user(request)
session = request.session session[:email],
name: session[:name],
phil-monroe / apify-tester.js
Last active Nov 13, 2018
Script to test apify page functions
View apify-tester.js
var page = require('webpage').create();
page.onConsoleMessage = function(msg, lineNum, sourceId) {
console.log('CONSOLE: ' + msg);
};'', function() {
page.includeJs("", function() {
page.evaluate(function() {

This is the title

  • bullet point
  • thing 2
View console_error.txt
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 / versioned_mailer_example.rb
Created Apr 17, 2016
Example of how to use mailer versioning in
View versioned_mailer_example.rb
class UserMailer < BaseMandrillMailer
# Template in mandrill: ":lang/user/forgot_password/v2"
def forgot_password(user, token)
build_message(user.language,, version: 2) do
# ^ note the named parameter "version"
# Merge Vars...
phil-monroe / example_presenter.rb
Created Feb 2, 2016
My attempt at a presenter and page objects for Rails
View example_presenter.rb
class TestPresenter < Presenter
let(:a) { 5 }
let(:b) { 3 }
let(:c) { a * b }
let(:str) { _.to_s }
let(:sym) { _.to_sym }
View Github
# 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 / SassMeister-input-HTML.haml
Created Oct 20, 2015
Generated by
View SassMeister-input-HTML.haml
The is the name
These are actions
Only in Print
You can’t perform that action at this time.