Skip to content

Instantly share code, notes, and snippets.

View iancanderson's full-sized avatar
😄
things!

Ian C. Anderson iancanderson

😄
things!
View GitHub Profile
@iancanderson
iancanderson / Beer.hs
Created April 1, 2016 18:19 — forked from MattMSumner/Beer.hs
make it werrkkkk
data Hop = Hop {name :: String, alphaAcid :: Double} deriving (Show)
type BoilTime = Double
type Ounces = Double
data HopAddition = HopAddition Hop Ounces BoilTime deriving (Show)
data HomebrewRecipe = HomebrewRecipe [HopAddition] deriving (Show)
-- http://www.realbeer.com/hops/FAQ.html#units
recipeIbus :: HomebrewRecipe -> Double
recipeIbus (HomebrewRecipe as) = sum $ map ibus as

Keybase proof

I hereby claim:

  • I am iancanderson on github.
  • I am iancanderson (https://keybase.io/iancanderson) on keybase.
  • I have a public key whose fingerprint is 69E6 AE7E 103C CBC2 71E6 CA7E 32F4 63EF B488 C3EB

To claim this, I am signing this object:

@iancanderson
iancanderson / looping_prompt.rb
Created November 3, 2011 23:03
looping_prompt.rb
# User story:
# - user runs ruby tasky.rb
# 1.) print menu
# tasky: "what would you like to do?"
# (n)ew task
# (l)ist tasks
# (c)omplete task
# (q)uit
# 2.) getting input
# user types in 'l', hits enter
@iancanderson
iancanderson / get_foreign_keys.sql
Created October 10, 2011 19:01
Get foreign key columns names of SQL SERVER tables
select pk.TABLE_NAME, c.COLUMN_NAME as 'foreign_key'
from INFORMATION_SCHEMA.TABLE_CONSTRAINTS pk ,
INFORMATION_SCHEMA.KEY_COLUMN_USAGE c
where
CONSTRAINT_TYPE = 'PRIMARY KEY'
and c.TABLE_NAME = pk.TABLE_NAME
and c.CONSTRAINT_NAME = pk.CONSTRAINT_NAME
order by pk.TABLE_NAME
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEApem8SDIu2VltmxkviH4C2vzh/wTyaX+R8/2vBMcwUDyKRS1in+CZFlV5ustGsxylWCFCGbxBljZUhpdNccLq+cMUaFGL46LU9ooVaNq6q9xtJfwdutdXxpRE4/gzs1IfTXzwNycmheogQx3PkIQZHDK3NqVNYvS6+xOaFYrYF2DAMr1vjRGJe9Yevu5HWXRArqIRX9YoGOCxWLvIE1MczzpoMdD1szXrSTwmPSaPLfnWYYUO2tds5c86qXo+z76WwOWLd2bK532j1xxpsOByjpagIUYY3qtBZT7f6B/SmbL8jbPQNLCvoQJGyxYDaybbijI2Islw5XXE3B8bqz9kow== iananderson@Ian-Andersons-iMac.local
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEApem8SDIu2VltmxkviH4C2vzh/wTyaX+R8/2vBMcwUDyKRS1in+CZFlV5ustGsxylWCFCGbxBljZUhpdNccLq+cMUaFGL46LU9ooVaNq6q9xtJfwdutdXxpRE4/gzs1IfTXzwNycmheogQx3PkIQZHDK3NqVNYvS6+xOaFYrYF2DAMr1vjRGJe9Yevu5HWXRArqIRX9YoGOCxWLvIE1MczzpoMdD1szXrSTwmPSaPLfnWYYUO2tds5c86qXo+z76WwOWLd2bK532j1xxpsOByjpagIUYY3qtBZT7f6B/SmbL8jbPQNLCvoQJGyxYDaybbijI2Islw5XXE3B8bqz9kow== iananderson@Ian-Andersons-iMac.local
@iancanderson
iancanderson / rails-wizard-2011-04-12.rb
Created April 13, 2011 01:15
template for my next rails app underway..
# >---------------------------------------------------------------------------<
#
# _____ _ _ __ ___ _
# | __ \ (_) | \ \ / (_) | |
# | |__) |__ _ _| |___\ \ /\ / / _ ______ _ _ __ __| |
# | _ // _` | | / __|\ \/ \/ / | |_ / _` | '__/ _` |
# | | \ \ (_| | | \__ \ \ /\ / | |/ / (_| | | | (_| |
# |_| \_\__,_|_|_|___/ \/ \/ |_/___\__,_|_| \__,_|
#
# This template was generated by RailsWizard, the amazing and awesome Rails
@iancanderson
iancanderson / jquery.pollForChanges.js
Created April 8, 2011 04:54
new jquery plugin in progress to support www.pilvinotes.com
(function( $ ){
$.fn.pollForChanges = function( interval, changedCallback ) {
// this maps element ids to corresponding values
var _mapIdsToValues = {};
// skip if not a textarea or an text input (for now)
var inputs = this.filter("textarea,input[type='text']");
# 2011-03-22
#
# Mac OS X 10.6.3
# Homebrew 0.7
# Xcode 3.2.4
# Git 1.7.3.1
# RVM 1.0.12
# Ruby 1.8.7, 1.9.2
# Passenger 2.2.15
# MySQL 5.1.49