Skip to content

Instantly share code, notes, and snippets.

# Import a posterous.com Blog into nanoc (http://nanoc.stoneship.org)
# Uses Nokogiri to parse the XML data from the posterous API
require 'rubygems'
require 'nanoc3'
require 'nokogiri'
require 'open-uri'
module Nanoc3::Extra
module Importers
@jccovey
jccovey / config.ru
Created July 9, 2010 02:34 — forked from toolmantim/config.ru
Rack::File, but serves directories, too
# Rackup file for serving up a static site from a "public" directory
#
# Useful for chucking a static site on Heroku
class IndexRewriter
def initialize(app) @app = app end
def call(env)
env["PATH_INFO"].gsub! /\/$/, '/index.html'
@app.call(env)
end
@jccovey
jccovey / web
Created June 16, 2010 03:20 — forked from schmidt/web
Serve current directory on next available port
#!/usr/bin/env ruby
require 'webrick'
require 'socket'
require 'timeout'
# code from http://stackoverflow.com/questions/517219/ruby-see-if-a-port-is-open/517638#517638
def port_in_use?(port)
begin
http://www.devcurry.com/2010/06/collection-of-free-programming-and.html
http://www.smashingmagazine.com/2010/06/10/50-new-useful-css-techniques-tools-and-tutorials/
http://thestonesoup.com/blog/images/free_stonesoup_ecookbook.pdf
http://danieltenner.com/posts/0018-how-to-lose-weight.html
http://ud.com/
http://www.webuiarchitect.com/tips-building-wireframes-for-web-ui
@jccovey
jccovey / jQuery Masonry Layout Plugin
Created May 28, 2010 17:45
jQuery Masonry Layout Plugin
http://desandro.com/resources/jquery-masonry/
http://desandro.com/mint/pepper/tillkruess/downloads/tracker.php?url=http://github.com/desandro/masonry/raw/master/js/jquery.masonry.min.js&remote
Configuring Masonry is fairly easy. Simply attach the .masonry() method to the wrapping container element in your jQuery script. Depending on the layout, you’ll most likely need to specify one option.
For layouts with elements that span multiple widths:
$('#wrapper').masonry({ columnWidth: 200 });
$(function(){
$(".texbox").autocomplete("/Services/DataService.svc/GetOptions", {
dataType: 'json',
parse: function(data) {
var items = data.d;
var parsed=[];
for(var i=0;i<items.length;i++)
parsed[i] = {
data: [items[i]],
Syntax highlighting in a Ruby gem
http://coderay.rubychan.de/
http://xahlee.org/emacs/ergonomic_emacs_keybinding.html
@jccovey
jccovey / import_tumblr_to_jekyll.rb
Created October 20, 2009 23:31 — forked from julesfern/import_tumblr_to_jekyll.rb
Quick script to import tumblr posts to jekyll markdown'd posts
#!/usr/bin/env ruby
# Script to import tumblr posts into local markdown posts ready to be consumed by Jekyll.
# Inspired by New Bamboo's post http://blog.new-bamboo.co.uk/2009/2/20/migrating-from-mephisto-to-jekyll
require 'rubygems'
require 'open-uri'
require 'nokogiri'
# Configuration
#Django-specific
import sys
import os
sys.path.append("/home/jccovey/django")
sys.path.append("/home/jccovey/django/projects")
os.environ['DJANGO_SETTINGS_MODULE'] = 'beta.settings'