Skip to content

Instantly share code, notes, and snippets.

View hstove's full-sized avatar

Hank Stoever hstove

View GitHub Profile
@hstove
hstove / gist:2dbd8830d83b8782f67f
Created July 31, 2014 17:03
terraform test file
variable "heroku_api_key" {}
variable "heroku_app_name" {}
# Configure the Heroku provider
provider "heroku" {
email = "hstove@gmail.com"
api_key = "${var.heroku_api_key}"
}
# Create a new applicaiton
<input id='query_example'>
<div id='results_box'>
<ul id='query_results'>
</ul>
</div>
<script>
$(document).ready(function(){
$('#query_example').keyup(function(){
var limit = 5;
@hstove
hstove / gist:2778381
Created May 23, 2012 23:01
recent price changes response
[
{
"id":18605663,
"oldPrice":17.24,
"title":"Okami",
"price":19.98,
"merchant":"Amazon.com",
"direction":1,
"image":"http://file.shopobot.com/products/videogames/nintendo-wii/okami-1-90.jpg",
"date":1337788745000,
{
"products":[
{
"priceNew":1494.44,
"title":"Canon 7D Body only New",
"prices":[
[
1335225600000,
1518.95
],
{
"history":[
[
1335225600000,
987.5
],
[
1335312000000,
987.5
],
@hstove
hstove / sample_user_class.rb
Created January 14, 2013 19:18
sample ruby user class with BCrypt for passwords from https://github.com/ryanb/nifty-generators
class User < ActiveRecord::Base
# new columns need to be added here to be writable through mass assignment
attr_accessible :username, :email, :password, :password_confirmation
attr_accessor :password
before_save :prepare_password
validates_presence_of :email
validates_uniqueness_of :username, :email, :allow_blank => true
console.log event._facilitators # => [undefined]
event._facilitators = _.compact(event._facilitators)
console.log _.compact(event._facilitators) # => []
console.log event._facilitators # => [undefined]
#Store('score') # undefined
#Store('score',1)
#Store('score') # 1
#Store('score','',-1) # expires
#Store('score') # undefined
#Store('score', 1) # 1
#Store('score', -> 2 ) # 1 only calls function if 'score' not found
#Store('score','',-1)
#Store('score', -> 2 ) # 2
@hstove
hstove / template.rb
Last active August 26, 2017 07:33
A template I use for creating Ruby on Rails apps
gem "bootstrap-sass", '~> 3.3.3'
gem "cancan"
gem "jquery-turbolinks"
gem "haml-rails"
gem "awesome_print"
gem "google-analytics-rails"
gem "ejs"
gem "paper_trail"
gem "nokogiri"
gem "dalli"
@hstove
hstove / keybase.md
Created December 19, 2017 23:51
Keybase

Keybase proof

I hereby claim:

  • I am hstove on github.
  • I am hstove (https://keybase.io/hstove) on keybase.
  • I have a public key ASBFHdyG8QXFmMkej0E-yJQPR10e-hFXmSeHeRLyZMXLUwo

To claim this, I am signing this object: