Skip to content

Instantly share code, notes, and snippets.

View funkatron's full-sized avatar

Ed Finkler funkatron

View GitHub Profile
@bytespider
bytespider / gist:785158
Created January 18, 2011 21:11
Appcelerator Titanium window drag
/*
Bullet Proof window drag
This is the most performant window dragging code
I could come up with. All the example on
developer.appcelerator.com we laggy
Version 2: More contained version
*/
@zerowidth
zerowidth / paginated_collection.js
Created November 18, 2010 22:04
first whack at pagination with backbone.js
// includes bindings for fetching/fetched
PaginatedCollection = Backbone.Collection.extend({
initialize: function() {
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage');
this.page = 1;
},
fetch: function(options) {
options || (options = {});
this.trigger("fetching");
@shapeshed
shapeshed / ee_disqus_exporter.rb
Created October 6, 2009 06:22
Import ExpressionEngine comments into Disqus
# Copyright 2009 Michael Ivey, released to public domain
# Disqus guts lifted from http://github.com/squeejee/disqus-sinatra-importer/tree/master
# I wanted it to run from MySQL and command line, instead of a Sinatra app
require 'rubygems'
require 'rest_client'
require 'json'
require 'sequel'
disqus_url = 'http://disqus.com/api'
@al3x
al3x / newpost.rb
Created April 22, 2009 23:50
Handy new post script for Jekyll blogs or similar
#!/usr/bin/env ruby
unless ARGV[0]
puts 'Usage: newpost "the post title"'
exit(-1)
end
date_prefix = Time.now.strftime("%Y-%m-%d")
postname = ARGV[0].strip.downcase.gsub(/ /, '-')
post = "/Users/al3x/src/al3x.github.com/_posts/#{date_prefix}-#{postname}.textile"
-- A script to have Paparazzi! <http://www.derailer.org/paparazzi/> take a screentshot
-- and save it.
-- by Benny Wong
-- 2008/10/02
--
-- Shamelessly adapted from <http://bbs.macscripter.net/viewtopic.php?pid=82666>
--
-- Usage:
-- $ osascript screenshotous.scpt URL FILENAME
--