Skip to content

Instantly share code, notes, and snippets.

View ericalli's full-sized avatar
🎯
Focusing on @getsiimple

Eric Alli ericalli

🎯
Focusing on @getsiimple
View GitHub Profile
// Import the following into your HTML
jquery.event.drag-2.2.js
jquery.event.drop-2.2.js
jquery.roundabout-shapes.min.js
jquery.roundabout.min.js
// Goes in watercolor.js
defaults: &defaults
api_key: r9g5t9reg09ergj
development:
<<: *defaults
test:
<<: *defaults
staging:
jQuery(window).load(function () {
jQuery("a.calendar_list").trigger("click");
});
filepicker.setKey('api_key');
filepicker.pickMultiple({
services: ['COMPUTER', 'DROPBOX' ]
},
function(files){
for (var i = 0; i < files.length; i++) {
var file = files[i];
filepicker.store(file, {
path: '/attachments/'+formatFileName(file.filename),
mimetype: 'Content-Disposition: attachment; filename="'+file.filename+'"'
<iframe width="230" height="345" src="http://www.youtube.com/embed/5xNGPl3gq8Q" frameborder="0" allowfullscreen></iframe>
filepicker.setKey('api_key');
filepicker.pickMultiple({
services: ['COMPUTER', 'FTP', 'DROPBOX' ]
},
function(files){
for (var i = 0; i < files.length; i++) {
var file = files[i];
filepicker.store(file, {path: '/attachments/'+file.key});
}
}
@ericalli
ericalli / each vs map.rb
Created October 27, 2012 00:12 — forked from jamiew/each vs map.rb
each vs map usage in ruby
json = ActiveSupport::JSON.decode(google)['predictions']
# sort of traditional for() loop style
results = []
json.each do |location|
results << {
:short => 'foo',
:long => 'bar'
}
end
@ericalli
ericalli / Retinafy
Created September 6, 2012 00:18
Retinafy
jQuery.fn.retinafy = function() {
var root = (typeof exports == 'undefined' ? window : exports);
if (root.devicePixelRatio > 1) {
return this.each(function() {
$(this).hide();
var image_src = $(this).attr("src");
var extension = image_src.substr(image_src.lastIndexOf('.'));
var filename = image_src.substr(0, image_src.lastIndexOf('.'));
var retina_src = filename+'@2x'+extension;
def ellipsisize(text, minimum_length=4,edge_length=3)
return text if text.length < minimum_length or text.length <= edge_length*2
edge = '.'*edge_length
mid_length = text.length - edge_length*2
text.gsub(/(#{edge}).{#{mid_length},}(#{edge})/, '\1...\2')
end
Cras justo odio, dapibus ac facilisis in, egestas eget quam. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla sed consectetur. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Sed posuere consectetur est at lobortis. Sed posuere consectetur est at lobortis.
[section_heading]Every little bit counts[/section_heading]
[donation_options description='Please choose a donation level. Paypal and credit card accepted.']
[donation_option link="#" text="Yay!" amount="$5" color="color_1"]
[donation_option link="#" amount="$5" color="color_2"]
[donation_option link="#" amount="$15" color="color_3"]
[donation_option link="#" amount="$5" color="color_4"]
[donation_option link="#" amount="$5" color="color_5"]