This file contains hidden or 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
# amazon.rb - amazon affiliate links for jekyll | |
# assumes that you have a configuration variable called 'amazon_associate_id' with your associate id | |
# usage: {{ asin | amazon_product_href }} | |
# returns url of a product | |
# usage: {{ asin | amazon_image_href: 'M' }} | |
# returns image of the product, size argument can be S, M, or L, default M | |
# usage: {{ asin | amazon_product: 'A Product' }} |
This file contains hidden or 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
# likes.rb - non intrusive sharing tags for jekyll/liquid | |
# usage (unfortunately rather verbose because of liquid) | |
# {{ site.url | append: page.url | facebook_likes }} => Fixnum | |
# {{ site.url | append: page.url | facebook_share_link }} => a link to share this page | |
# {{ site.url | append: page.url | twitter_tweets }} => Fixnum | |
# {{ site.url | append: page.url | twitter_share_link }} => Fixnum | |
# if you're doing it a lot, try something like this | |
# {% assign absolute = site.url | append: page.url %} | |
# NOTE: twitter ignores localhost urls. if you try to tweet one, the url will not appear in your tweet |
This file contains hidden or 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
-- Circular buffer functionality | |
local Buffer = {} | |
function Buffer:new(ob) | |
local o = ob or {} | |
o.entries = #o | |
o.cursor = #o + 1 | |
o.max = 10 | |
setmetatable(o, self) | |
self.__index = self |
This file contains hidden or 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
filetype plugin indent on | syntax on | set ruler gd hls scs ic hid ts=2 sts=2 sw=2 tw=79 fo=cq nuw=5 wmnu wim=full cul cino=l1,(0 | map ; : | map i <Up> | map j <Left> | map k <Down> | noremap h i | set number |
This file contains hidden or 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/python | |
# usage: ./largest-files.py <file> ... | |
# for instance: ./largest-files.py *.c | |
# to find the largest c file in the current directory | |
import glob, sys, os, pprint | |
files = sys.argv[1:] | |
lines = [] | |
for x in files: |
NewerOlder