This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#volly_form").validate({ | |
errorPlacement: function(error) { | |
$("span.error_container").html("Please double-check that you\'ve filled in both fields and provided a U.S. area code and mobile number."); | |
}, | |
submitHandler: function() { | |
var request_data = { | |
full_name: $('#new_volly_full_name').val(), | |
phone: $('#new_volly_phone').val() | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module AttributeSerializer | |
module ActiveRecordExtensions | |
module ClassMethods | |
def serializeable(serialized, serialized_accessors={}) | |
serialize serialized, serialized_accessors.class | |
serialized_attr_accessor serialized, serialized_accessors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Creates finders | |
def serialized_finder(serialized, accessors) | |
accessors.keys.each do |k| | |
method_name = "find_by_#{k}" | |
define_singleton_method(method_name) do |val=nil| | |
a = [] | |
a << self.all.select { |s| | |
s[serialized][k] == val | |
} | |
a unless a.empty? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.colorpicker').bind('click', function(evt) { | |
var tgt = $(this); | |
tgt.parent().prepend('<div id="colorpicker-overlay"></div>'); | |
$('#colorpicker-overlay').farbtastic(function() { | |
// handle form update | |
tgt.val(this.color); | |
tgt.css('background-color', this.color); | |
// update object | |
CSTM.colors[tgt.attr('id')] = this.color; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"previous":{"collection":{"get_date":"2011-03-24","id":1,"theme_name":"Terrible 2s - Fact or Fiction?","collection_type":"top 9","url_slug":"terrible-2s-are-nutz","comment_cue":"Do you have a terrible 2?","description":"","status":"draft"}},"next":null} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window do | |
run 'cd wp-content/themes/<YOUR_THEME_NAME>' | |
run "compass watch" | |
tab do | |
run 'cd wp-content/themes/<YOUR_THEME_NAME>' | |
run "jitter src/coffeescript javascripts" | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http_path = "/" | |
css_dir = "stylesheets" | |
sass_dir = "src/sass" | |
images_dir = "images" | |
javascripts_dir = "javascripts" | |
output_style = :compressed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'jammit' | |
print "JAMMIT: Looking for changes to tracked assets... " | |
# take a look at the status before compression | |
status_before = %x[git status --porcelain --untracked-files=no] | |
# package changed assets | |
Jammit.package! | |
# now take a look at the status after compressing assets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User | |
include Mongoid::Document | |
# herein might appear a metric shitton of fields | |
# but what you need to know for feature flags follows | |
field :feature_flags, :type => Hash, :default => {} | |
# likewise, this is only what you need for |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* | |
* stagas - polytropon | |
* | |
*/ | |
var transpose = 0; | |
// patterns |
OlderNewer