Skip to content

Instantly share code, notes, and snippets.

View scottjacobsen's full-sized avatar

Scott Jacobsen scottjacobsen

View GitHub Profile
@scottjacobsen
scottjacobsen / error.txt
Created April 2, 2015 23:14
parallels-vagrant-error
vagrant@vagrant% sudo -u postgres ls
Sorry, user vagrant is not allowed to execute '/bin/ls' as postgres on vagrant.vm.
@scottjacobsen
scottjacobsen / sudoers
Created April 2, 2015 22:55
parallels-vagrant-sudo
vagrant ALL=(ALL) NOPASSWD:ALL
@scottjacobsen
scottjacobsen / test.rb
Last active August 29, 2015 14:13
benchmark_method_missing
require "benchmark"
class ViewContext
def hello
"hello"
end
end
class SimpleMethodMissing
def initialize
/((http:\/\/(.*youtube\.com\/watch.*|.*\.youtube\.com\/v\/.*|youtu\.be\/.*|.*\.youtube\.com\/user\/.*|.*\.youtube\.com\/.*#.*\/.*|m\.youtube\.com\/watch.*|m\.youtube\.com\/index.*|.*\.youtube\.com\/profile.*|.*\.youtube\.com\/view_play_list.*|.*\.youtube\.com\/playlist.*|www\.youtube\.com\/embed\/.*|.*twitch\.tv\/.*|.*twitch\.tv\/.*\/b\/.*|www\.ustream\.tv\/recorded\/.*|www\.ustream\.tv\/channel\/.*|www\.ustream\.tv\/.*|ustre\.am\/.*|qik\.com\/video\/.*|qik\.com\/.*|qik\.ly\/.*|.*revision3\.com\/.*|.*\.dailymotion\.com\/video\/.*|.*\.dailymotion\.com\/.*\/video\/.*|collegehumor\.com\/video:.*|collegehumor\.com\/video\/.*|www\.collegehumor\.com\/video:.*|www\.collegehumor\.com\/video\/.*|telly\.com\/.*|www\.telly\.com\/.*|break\.com\/.*\/.*|www\.break\.com\/.*\/.*|vids\.myspace\.com\/index\.cfm\?fuseaction=vids\.individual&videoid.*|www\.myspace\.com\/index\.cfm\?fuseaction=.*&videoid.*|www\.metacafe\.com\/watch\/.*|www\.metacafe\.com\/w\/.*|blip\.tv\/.*\/.*|.*\.blip\.tv\/.*\/.*|video\.google\.com\/videoplay\?
@scottjacobsen
scottjacobsen / anonymous-gist.
Last active August 29, 2015 14:07
path weirdness
exec-path is a variable defined in `C source code'.
Its value is
("/Users/scott/.rubies/ruby-2.1.3/bin" "/Users/scott/.gem/ruby/2.0.0/bin" "/opt/local/bin" "/Users/scott/.gem/ruby/2.1.3/bin" "/Users/scott/.rubies/ruby-2.1.3/lib/ruby/gems/2.1.0/bin" "/Users/scott/devhome/git/neighborland.com/bin" "/Users/scott/bin" "/Users/scott/.cask/bin" "/usr/local/bin" "/usr/local/sbin" "/usr/bin" "/bin" "/usr/sbin" "/sbin" "/usr/local/bin" "/opt/X11/bin" "/Users/scott/scripts/bin" "/Users/scott/node_modules/.bin" "/usr/local/Cellar/emacs/HEAD/libexec/emacs/25.0.50/x86_64-apple-darwin13.4.0")
value from shell-command env:
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/Users/scott/.gem/ruby/2.0.0/bin:/Users/scott/.rubies/ruby-2.1.3/bin:/opt/local/bin:/Users/scott/.gem/ruby/2.1.3/bin:/Users/scott/.rubies/ruby-2.1.3/lib/ruby/gems/2.1.0/bin:/Users/scott/devhome/git/neighborland.com/bin:/Users/scott/bin:/Users/scott/.cask/bin:/usr/local/sbin:/Users/scott/scripts/bin:/Users/scott/node_modules/.bin
eterm-color|Emacs term.el terminal emulator term-protocol-version 0.96,
#
# The code here is forced by the interface, and is not subject to
# copyright, constituting the only possible expression of the algorithm
# in this format.
#
# When updating this file, etc/e/eterm-color should be regenerated by
# running "make e/eterm-color" in the etc directory.
# Any change to this file should be done at the same time with a
# corresponding change to the TERMCAP environment variable in term.el.
@scottjacobsen
scottjacobsen / anonymous-gist.
Created August 7, 2014 23:04
passenger-error
(staging-web) root@ip-10-0-1-132 /var/log/nginx# cat /tmp/passenger_native_support-rmfgcc.log
# mkdir -p /home/neighborland/.passenger/native_support/4.0.48/ruby-2.1.2-x86_64-linux-gnu
# cd /home/neighborland/.passenger/native_support/4.0.48/ruby-2.1.2-x86_64-linux-gnu
# /usr/bin/ruby2.1 /usr/share/passenger/ruby_extension_source/extconf.rb
checking for alloca.h... *** /usr/share/passenger/ruby_extension_source/extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
@scottjacobsen
scottjacobsen / post-merge
Last active August 29, 2015 13:55
post-merge
#!/bin/sh
bundle check || bundle
#assuming schema is
# table turbines
# id integer
# turbine_type_id integer
# table turbine_types
# id integer
# name string
class Turbine < ActiveRecord::Base
ACCEPT_KEYWORDS="~amd64"
INPUT_DEVICES="evdev synaptics"
FEATURES="parallel-fetch"
LINGUAS="en_US"
ACCEPT_LICENSE=*
PORTDIR_OVERLAY=/usr/local/portage
APACHE2_MPMS=prefork
EMERGE_DEFAULT_OPTS="--quiet-build=y"
RUBY_TARGETS="ruby19"
USE="mmx sse sse2 -esd -swat -gnome -qt -qt3 -qt4 -kde laptop quicktime \