Skip to content

Instantly share code, notes, and snippets.

View hstove's full-sized avatar

Hank Stoever hstove

View GitHub Profile
@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
{
"history":[
[
1335225600000,
987.5
],
[
1335312000000,
987.5
],
{
"products":[
{
"priceNew":1494.44,
"title":"Canon 7D Body only New",
"prices":[
[
1335225600000,
1518.95
],
@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,
<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;