posts | seconds | time |
---|---|---|
1 | 0.824 | 0:0.824 |
100 | 2.644 | 0:2.644 |
1000 | 25.071 | 0:25.071 |
5000 | 186.715 | 3:6.715 |
10000 | 536.904 | 8:56.904 |
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
FROM ubuntu:12.04 | |
#Install Ruby | |
RUN apt-get update | |
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install ruby1.9.1 ruby1.9.1-dev make | |
#Pygments doesn't seem to want to work regardless of version installed | |
RUN gem install pygments.rb | |
#Install Jekyll | |
RUN gem install jekyll |
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
require 'csv' | |
module JekyllCsv | |
class Generator < Jekyll::Generator | |
def generate(site) | |
dir = File.expand_path "_csvs", site.source | |
return if site.safe && File.symlink?(dir) | |
entries = Dir.chdir(dir) do | |
Dir['*.csv'] |
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 python | |
""" | |
Script to copy all bookmarks from Read It Later to Instapaper. | |
See also http://readitlaterlist.com/api/docs/#get | |
and http://www.instapaper.com/api/simple | |
""" | |
import urllib, urllib2, json |
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
require 'omniauth/oauth' | |
require 'multi_json' | |
module OmniAuth | |
module Strategies | |
class Instapaper < OmniAuth::Strategies::XAuth | |
def initialize(app, consumer_key = nil, consumer_secret = nil, options = {}, &block) | |
client_options = { | |
:title => 'Instapaper', |
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 python | |
# By Parker Moore, http://www.parkermoore.de/ | |
# Referenced the following URLs and compiled: | |
# http://lookherefirst.wordpress.com/2007/12/03/check-if-an-entry-is-a-file-or-directory-in-python/ | |
# http://stackoverflow.com/questions/845058/how-to-get-line-count-cheaply-in-python | |
import sys, os | |
def file_len(fname): |
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
# This this replacemnt for default rails field_with_errors for using http://www.yaml.de/docs/index.html#yaml-forms | |
# Add this to ./config/environment.rb file | |
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| | |
if html_tag =~ /<label/ | |
%|<div class="ym-error"><p class="ym-message">#{[instance.error_message].join(', ')}</p>#{html_tag}</div>|.html_safe | |
else | |
%|<div class="ym-error">#{html_tag}</div>|.html_safe | |
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
""" | |
Pythonist script to expand any URL surrounded by **'s | |
""" | |
import clipboard | |
import requests | |
import webbrowser | |
import urlparse | |
from urllib import quote, urlencode |
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
require 'guards/guard-jekyll-plus.rb' | |
# Sample guard | |
guard :jekyll do | |
watch /^source/ | |
watch '_config.yml' | |
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
""" | |
Example of using the old BeautifulSoup API to extract content from downloaded html files into CSV... if you're doing this sort of thing today, I recommend using the newer lxml interface directly, but lxml also has a BeautifulSoup compatibility layer. | |
""" | |
import os | |
OlderNewer