Skip to content

Instantly share code, notes, and snippets.

View bill-evanson's full-sized avatar

Bill Evanson bill-evanson

  • The University of Iowa
  • Iowa City, Iowa
View GitHub Profile
@bill-evanson
bill-evanson / idea
Created July 11, 2016 18:05 — forked from chrisdarroch/idea
Open a project in IntelliJ IDEA from your command line!
#!/bin/sh
# check for where the latest version of IDEA is installed
IDEA=`ls -1d /Applications/IntelliJ\ * | tail -n1`
wd=`pwd`
# were we given a directory?
if [ -d "$1" ]; then
# echo "checking for things in the working dir given"
wd=`ls -1d "$1" | head -n1`
/**
* Like an internal redirect or an proxy. The URL in the browser doesn't
* change.
*/
public Promise<Result> forwardTo(String url) {
Promise<WS.Response> response = WS.url(url).get();
return response.map(new Function<WS.Response, Result>() {
public Result apply(WS.Response response) {
// Prevent browser from caching pages - this would be an
// security issue
Use /usr/libexec/java_home -v 1.7 command on a terminal shell to figure out where is your java 1.7 home directory
@bill-evanson
bill-evanson / gist:3be748d683a8b01f7f1f
Created January 10, 2015 14:39
brew install mysql
brew install mysql
==> Installing mysql dependency: openssl
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/openssl-1.0
######################################################################## 100.0%
==> Pouring openssl-1.0.1k.yosemite.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
/usr/local/etc/openssl/certs
@bill-evanson
bill-evanson / gist:f613ed97098756ba7a82
Created November 15, 2014 19:03
Yosemite Problems - brew hosed
#if brew is already installed:
rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
\curl -L https://get.rvm.io | bash -s stable --ruby
@bill-evanson
bill-evanson / gist:cc7235c7c67b44e46480
Created September 18, 2014 15:48
assets error when moving app to production
Apparently this has to be done explicitly now...
ActionView::Template::Error (application.css isn't precompiled)
bundle exec rake assets:precompile
@bill-evanson
bill-evanson / gist:aac7e49550c11b2a8028
Created September 11, 2014 22:00
referencing name space in rails form_for
<%= form_for [:office, image], :action => 'update', :method => "PUT" do |f| %>
<input type='hidden' name='id' value='<%= image.id %>'>
<input type='hidden' name='listing_id' value='<%= listing.id %>'>
<%= f.submit "Set Default", :class => 'btn btn-link' %>
<% end %>
@bill-evanson
bill-evanson / gist:990469f6f9e4abb1d89d
Created September 6, 2014 04:47
UNDEFINED METHOD MIGRATION_ERROR
#Rolling a Rails 4 project back to Rails 3 caused this error for me. Deleting the following line from config/environments/development.rb fixed the issue:
config.active_record.migration_error = :page_load
# Since Rails ships with so many dependencies these days, we're going to need to install a Javascript runtime like NodeJS. This # lets you use Coffeescript and the Asset Pipeline in Rails which combines and minifies your javascript to provide a faster # # # production environment.
# To install NodeJS, we're going to add it using a PPA repository:
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
gem install rails --version '~> 3.2.9'
@bill-evanson
bill-evanson / gist:a68b456b2bc367a29917
Created August 31, 2014 14:23
Error installing rails 3.2.9 on Ubuntu 14.04
#ERROR Installing Rails - failed to build native extensions
#This seemed to fix it:
sudo apt-get install build-essential
sudo apt-get install curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev
#`require': no such file to load — mkmf (LoadError)
sudo apt-get install ruby-dev