Skip to content

Instantly share code, notes, and snippets.

View jvanderhoof's full-sized avatar

Jason Vanderhoof jvanderhoof

View GitHub Profile
Setup steps for installing FreeTDS on Ubuntu 9.04
sudo apt-get install unixodbc unixodbc-dev tdsodbc freetds-dev libodbc-ruby1.8
sudo gem install dbi dbd-odbc --no-ri --no-rdoc
sudo apt-get install -y sqsh
export ODBCINI=/etc/odbc.ini
export ODBCSYSINI=/etc
export FREETDSCONF=/etc/freetds/freetds.conf
class GenericHashLookup
attr_accessor :state_hash, :office_hash, :agent_hash
def state(abbr)
generic_getter(Mls::State, 'state_hash', 'abbreviation', abbr)
end
def office_hash(mls_id)
generic_getter(Mls::Office, 'office_hash', 'mls_id', mls_id)
end
# some experimentation around generating OG, IBU, & SRM for based on beer ingredients
grains = [{:name => 'Liquid Malt Extract', :amount => 6, :measurement => 'lbs', :efficency => 1, :ppg => 36, :color => 4},
{:name => 'Crystal Malt 60L', :amount => 1, :measurement => 'lbs', :efficency => 0.85, :ppg => 34, :color => 60}]
hops = [{:name => 'Fuggles', :amount => 2, :measurement => 'oz', :aau => 3.6, :time => 30},
{:name => 'Willamette', :amount => 1, :measurement => 'oz', :aau => 4.3, :time => 10}]
total_size = 5
boil_size = 3
@jvanderhoof
jvanderhoof / gist:1259171
Created October 3, 2011 14:07
Brewershub - Backbone JS
_.templateSettings = {
evaluate : /<\?([\s\S]+?)\?>/g,
interpolate : /<\?=([\s\S]+?)\?>/g
};
(function($) {
////// VIEWS ///////
window.IngredientView = Backbone.View.extend({
tagName: 'li',
namespace :deploy do
def format_column(str, length)
(length - str.length).times do
str += ' '
end
str
end
def table_display(table_hsh, columns)
@jvanderhoof
jvanderhoof / extole-test.html
Last active August 29, 2015 14:01
Gazelle Extole
<html>
<head>
<script src="//tags.extole.com/913653/core.js"></script>
</head>
<body>
<div>
Old link: <a href="http://gazelle.extole.com/m/95448701" id="refer_a_friend_link" target="_blank">Refer a Friend</a>
</div>
<div>
New Link:
@jvanderhoof
jvanderhoof / gist:bf3107f56f571ca75c6e
Created December 1, 2014 17:42
JS Namespace Example
var ImeiChecker = {
test_one: 'testing 1',
test_two: 'testing 2'
};
// Then you can retrieve the values:
ImeiChecker.test_one; // => testing 1
// Update the values:
source "https://supermarket.chef.io"
cookbook 'haproxy'
diff --git a/template/Emails/order_status_email.html b/template/Emails/order_status_email.html
index 5506dca..76a16d3 100644
--- a/template/Emails/order_status_email.html
+++ b/template/Emails/order_status_email.html
@@ -1,35 +1,87 @@
-<html><body style="font-family: Arial; font-size: 12px;">
- <div style="padding: 0 20px 20px 20px;">
- <h2 style="font-size:22px; height:30px; color:#cc6600; border-bottom:dashed 1px gray">%%LNG_OrderStatusChanged%%</h2>
-
- <p>%%GLOBAL_OrderStatusChangedHi%%</p>
@jvanderhoof
jvanderhoof / pg_hba.conf
Created February 24, 2015 11:33
Postgres config file for trusted local access.
# PostgreSQL Client Authentication Configuration File
# ===================================================
#
# Refer to the "Client Authentication" section in the PostgreSQL
# documentation for a complete description of this file. A short
# synopsis follows.
#
# This file controls: which hosts are allowed to connect, how clients
# are authenticated, which PostgreSQL user names they can use, which
# databases they can access. Records take one of these forms: