Skip to content

Instantly share code, notes, and snippets.

View arlm's full-sized avatar

Alexandre Rocha Lima e Marcondes arlm

View GitHub Profile
# An example Jekyll generator. Utilizes the new plugin system.
#
# 1. Make a _plugins directory in your jekyll site, and put this class in a file there.
# 2. Upon site generation, version.html will be created in your root destination with
# # the version of Jekyll that generated it
module Jekyll
class VersionReporter < Generator
safe true
public class ImageElement : Element {
// The original ImageElement didn't scale the picture that was displayed as the thumbnail properly
// this code probably needs lots of refactoring but I needed a quick solution.
public UIImage Value;
static RectangleF rect = new RectangleF (0, 0, dimx, dimy);
static NSString ikey = new NSString ("ikey");
UIImage scaled;
// Apple leaks this one, so share across all.
@ryanbriones
ryanbriones / post-receive
Created July 28, 2009 03:53
post receive hook to export a working copy and jekyll it
# "export" the working-copy to a place we can "jekyll" it.
# this can probably be done better.
git --bare --git-dir=/home/ryanbriones/sites/ryanbriones/source.git archive master | tar xC /home/ryanbriones/sites/ryanbriones/source
jekyll /home/ryanbriones/sites/ryanbriones/source /home/ryanbriones/sites/ryanbriones/public
require 'fileutils'
class Jekyll < Thor
include FileUtils
method_options :format => :optional
def draft(name)
format = options[:format] || "markdown"
slug = name.downcase.gsub(/ +/,'-').gsub(/[^-\w]/,'').sub(/-+$/,'')
filename = slug + ".#{format}"