Skip to content

Instantly share code, notes, and snippets.

View jnwheeler44's full-sized avatar

Justin Wheeler jnwheeler44

View GitHub Profile
@jnwheeler44
jnwheeler44 / circle.yml
Created December 29, 2016 19:34
How to use Postgres 9.6.1 on circleci 14.04 image
# Other settings have been omitted, the below changes are relevant
machine:
pre:
- sudo service postgresql stop
- sudo apt-get purge -y postgresql*
- sudo apt-get update
- sudo apt-get install postgresql
- sudo service postgresql start
- sudo su - postgres -c "echo \"create user ubuntu with password 'ubuntu';\" | psql"
- sudo su - postgres -c "echo \"alter user ubuntu with superuser;\" | psql"
@jnwheeler44
jnwheeler44 / streets.rb
Last active August 29, 2015 14:27
Street Names and Abbreviations Array
module StreetNames
def list
%w{ALLEY
ALLEE
ALY
ALLEY
ALLY
ALY
User.detect_or_create(:by => { :email => "[email protected]" },
:with => { :name => "wheeler", :active => true },
:overwrite_existing => true)
user = User.find_or_create_by_username(:username => "wheeler", :email => "[email protected]")
user.username
# => {:username => "wheeler, :email => "[email protected]")
user= User.find_or_create_by_company_id(:company_id => 23, :username => "wheeler")
user.company_id
# => 1
@jnwheeler44
jnwheeler44 / Vegan_Gumbo.md
Last active November 1, 2022 23:20
Vegan Gumbo

Ingredients

1.5 tablespoons plus 1/2 cup vegetable oil (have had good results with canola)

1 pound vegan smoked sausage, such as andouille or kielbasa, cut crosswise 1/2-inch thick pieces

4 oz soy curls

2.5 tablespoons Better Than Bouillon No-Chicken Base

1 tablespoon Creole seasoning

def create
Hotel.create(safe_params)
end
private
def safe_params
params[:hotel].slice(:name, :address, :city, :state, :zip)
end
<h3 class="widget-title">
Tech
<span style="color:#00b0f0">n</span>
<span style="color:#ffff01">o</span>
<span style="color:#fe0000">l</span>
<span style="color:#00ff01">a</span>
gy TechFest
<br>&nbsp;<br>
<span class="style3">New Orleans Science &amp; Technology Festival</span>
</h3>
class Thing < ActiveRecord::Base
def user_name
user.name if user.present?
end
end
@jnwheeler44
jnwheeler44 / console.js
Created January 21, 2013 16:17
jQuery console on page without jQuery
var script= document.createElement('script');
script.type= 'text/javascript';
script.src = "//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js";
var $j = jQuery.noConflict();
@jnwheeler44
jnwheeler44 / gist:4530342
Last active December 11, 2015 02:28
Incorrect MySQL client library version! This gem was compiled for 5.5.27 but the client library is 6.0.0. (RuntimeError)
If you get this: "Incorrect MySQL client library version! This gem was compiled for 5.5.27 but the client library is 6.0.0. (RuntimeError)"
The error might be because of a conflicting mysql-connector-c package installed by homebrew.
brew uninstall mysql-connector-c
gem uninstall mysql2
bundle