Skip to content

Instantly share code, notes, and snippets.

# Example to initialize gridster and handle resizing
# Module grid settings
WIDGET_BASE_DIMENSIONS_X = WIDGET_DESKTOP_X = 140
WIDGET_BASE_DIMENSIONS_Y = 20
WIDGET_CONTAINER_SELECTOR = '.widget-view'
WIDGET_MOBILE_CUTOFF_WIDTH = 768
NUM_WIDGETS = 15
$ ->
@Shpigford
Shpigford / Failed Bank Import email.
Last active December 24, 2015 12:29 — forked from lessallan/Failed Bank Import email.
Not really any shorter, but definitely less dry and more human.
Subject: Action Needed: Can't import your finacial data!
Hey <first name or friend>!
We're having trouble importing your financial bits in to LessAccounting.
Seems your login details are outdated for <insert bank name>.
So, to keep your financial details spot on, we need to make sure that data gets imported.
@Shpigford
Shpigford / api.rb
Created October 25, 2012 17:19 — forked from gertig/api.rb
Snippets for an API with grape
# Server App
# This file must be in lib/myapp/api.rb
module MyApp
module Entities
class Products < Grape::Entity
expose :id, :code, :name, :short_description
expose :description, :unless => { :collection => true }
expose (:category) { |model, options| model.category.name }
expose (:brand) { |model, options| model.brand.name }
end
@Shpigford
Shpigford / clockwork.rake
Created September 15, 2011 01:05 — forked from andrewvc/clockwork.rake
Using the Clockwork gem from a rake task
task :clockwork => :environment do
Clockwork.every(10.seconds, "events.update_viewers") {
Resque.enqueue(ViewerCountWorker)
}
Clockwork.run
end
/*
Form Elements
-- Styled to look like native Safari on OS X.
-- Drop-down <select> menus are unaffected.
-- Buttons are unaffected. Native OS style.
*/
input,
button,
select,
// Run via OS X Terminal.app to block junk tweets in Tweetie.
// Info: http://atebits.posterous.com/test-filtering-in-tweetie-for-mac
defaults write com.atebits.tweetie-mac filterTerms -array "@gowalla" "http://gowal.la" "@foursquare" "http://4sq.com" "lunch"
/* `Rounded Corners
----------------------------------------------------------------------------------------------------*/
.round_all {
-khtml-border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
}