Skip to content

Instantly share code, notes, and snippets.

View scarver2's full-sized avatar

Stan Carver II scarver2

View GitHub Profile
I am the owner of lvh.me. And I'm glad to hear it's helpful. In truth, it's just a fancy DNS trick. lhv.me and all of it's sub-domains just point back to your computer (127.0.0.1). That means running ssl is as simple (or difficult) as running ssl on your computer.
I'm not sure how comfortable you are with the command line, but here's my how I setup my development environment. (rvm, passenger, nginx w/ SSL, etc).
# Install rvm (no sudo!)
# ------------------------------------------------------
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
source ~/.rvm/scripts/rvm
rvm install ree-1.8.7-2010.02
@scarver2
scarver2 / output log from health
Created April 1, 2015 18:38
i18n-tasks missing scan: invalid byte sequence in UTF-8
i18n-tasks health
/Users/scarver2/.rvm/gems/ruby-2.2.1/gems/i18n-tasks-0.8.0/lib/i18n/tasks/data/file_system_base.rb:141:in `read_locale': undefined method `map' for nil:NilClass (NoMethodError)
from /Users/scarver2/.rvm/gems/ruby-2.2.1/gems/i18n-tasks-0.8.0/lib/i18n/tasks/data/file_system_base.rb:39:in `get'
from /Users/scarver2/.rvm/gems/ruby-2.2.1/gems/i18n-tasks-0.8.0/lib/i18n/tasks/data.rb:27:in `block in data_forest'
from /Users/scarver2/.rvm/gems/ruby-2.2.1/gems/i18n-tasks-0.8.0/lib/i18n/tasks/data.rb:26:in `each'
from /Users/scarver2/.rvm/gems/ruby-2.2.1/gems/i18n-tasks-0.8.0/lib/i18n/tasks/data.rb:26:in `inject'
from /Users/scarver2/.rvm/gems/ruby-2.2.1/gems/i18n-tasks-0.8.0/lib/i18n/tasks/data.rb:26:in `data_forest'
from /Users/scarver2/.rvm/gems/ruby-2.2.1/gems/i18n-tasks-0.8.0/lib/i18n/tasks/command/commands/health.rb:13:in `health'
from /Users/scarver2/.rvm/gems/ruby-2.2.1/gems/i18n-tasks-0.8.0/lib/i18n/tasks/command/commander.rb:22:in `run'
from /Users/scarver2/.rvm/gems/ruby-2.2.1/gems/
@scarver2
scarver2 / form.js.coffee
Created March 6, 2015 16:54
Auto-submit form on select change
# Submit Kaminari on limit change
selected. $ ->
$('#limit').change ->
$(this).closest('form').submit();
@scarver2
scarver2 / mkmf.log
Created February 6, 2015 16:19
OSX ruby-filemagic-0.6.2 build failure log
"gcc -o conftest -I/Users/me/.rvm/rubies/ruby-2.2.0/include/ruby-2.2.0/x86_64-darwin14 -I/Users/me/.rvm/rubies/ruby-2.2.0/include/ruby-2.2.0/ruby/backward -I/Users/me/.rvm/rubies/ruby-2.2.0/include/ruby-2.2.0 -I. -I/usr/local/include -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe conftest.c -L/usr/local/lib/ -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L. -L/Users/me/.rvm/rubies/ruby-2.2.0/lib -L. -fstack-protector -L/usr/local/opt/libyaml/lib -
echo "* Updating system"
apt-get update
apt-get -y upgrade
echo "* Installing packages"
apt-get -y install build-essential libmagickcore-dev imagemagick libmagickwand-dev libxml2-dev libxslt1-dev git-core nginx redis-server curl nodejs htop
id -u deploy &> /dev/null
if [ $? -ne 0 ]
then
@scarver2
scarver2 / after.rb
Created July 14, 2014 13:24
Nokogiri XML builder with attributes and no xml declaration
require 'nokogiri'
def common_code_for_element_recipients(numbers)
xml = Nokogiri::XML::Builder.new
xml.recipients do
numbers.each do |number|
if number.is_a? Hash
xml.recipient(uid: number[:uid]) { xml.text number[:uid] }
else
xml.recipient number
@scarver2
scarver2 / FormtasticStringInputError.log
Created May 7, 2014 12:31
Formtastic StringInput Error log
Application
[PROJECT_ROOT]/app/views/sessions/new.html.haml:5:in `block (2 levels) in _app_views_sessions_new_html_haml__1904073237958185336_70056720138860`
[PROJECT_ROOT]/app/views/sessions/new.html.haml:4:in `block in _app_views_sessions_new_html_haml__1904073237958185336_70056720138860`
[PROJECT_ROOT]/app/views/sessions/new.html.haml:3:in `_app_views_sessions_new_html_haml__1904073237958185336_70056720138860`
Full
[GEM_ROOT]/gems/formtastic-2.3.0.rc3/lib/formtastic/helpers/input_helper.rb:337:in `input_class_with_const_defined`
[GEM_ROOT]/gems/formtastic-2.3.0.rc3/lib/formtastic/helpers/input_helper.rb:324:in `input_class`