Skip to content

Instantly share code, notes, and snippets.

@seandenigris
seandenigris / gist:322074
Created March 4, 2010 20:28
Syntax highlight files in Quicklook
# Snippet to syntax-highlight source code files matching a certain pattern in Quicklook
# See see http://seandenigris.com/?p=412 for more info for more info
# Used with the qlcolorcode plugin
# Insert into QLColorCode.qlgenerator/Contents/Resources/colorize.sh
# Works for files in languages known to highlight (see qlcolorcode docs), but because of their filename, aren't recognized by Quicklook
#The commented lines are already in the file
#
# debug Handling special cases
require 'rubygems'
require 'sinatra'
require 'haml'
get '/' do
haml :index, :layout => false #=> Don't use layout.haml.
end
get '/about' do
haml :about, :layout => 'layout2' #=> Use layout2.haml.
@chrisjacob
chrisjacob / README.md
Created February 18, 2011 03:44
Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").

Intro

Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").

Author: Chris Jacob @_chrisjacob

Tutorial (Gist): https://gist.github.com/833223

The Result

@somic
somic / category_plugin.rb
Created March 2, 2011 23:37
How I organize posts in Jekyll (code snippets for blog post - see comments)
module Jekyll
Page.class_eval {
def clone
Page.new(@site, @base, @dir, @name)
end
}
@argent-smith
argent-smith / Rakefile
Created April 9, 2011 07:53
An example of Rakefile of a Jekyll site which sets LANG before doing site generation.
require 'rubygems'
require 'rake'
require 'rake/clean'
require 'rake/gempackagetask'
require 'rake/testtask'
LANG = "ru_RU.UTF-8"
SET_CMD = case RUBY_PLATFORM
when /mingw32/ then "set"
@brainsatwork
brainsatwork / CopyPathToClipboard.applescript
Created April 13, 2011 21:32
applescript which copies current Finder path to clipboard.
-- click on icon
try
tell application "Finder"
set currentPath to (POSIX path of (target of front window as alias))
set the clipboard to currentPath
end tell
on error
my finderErrorMsg()
end try
-- drop folder on icon
@wolfeidau
wolfeidau / sass_converter.rb
Created May 7, 2011 02:43
Sass plugin for Jekyll
module Jekyll
# Sass plugin to convert .scss to .css
#
# Note: This is configured to use the new css like syntax available in sass.
require 'sass'
class SassConverter < Converter
safe true
priority :low
def matches(ext)
@kopischke
kopischke / markdown2evernote.rb
Created June 5, 2011 16:57
OS X service scripts
#!/usr/bin/env ruby -wKU
# Adapted from Brett Terpstra’s original “Markdown to Evernote” service (http://brettterpstra.com/a-better-os-x-system-service-for-evernote-notes-with-multimarkdown/)
# Martin Kopischke 2011 – License: Creative Commons Attribution Share-Alike (CC BY-SA) 3.0 Unported (http://creativecommons.org/licenses/by-sa/3.0/)
# Changes: – create only one Evernote note per (Multi)Markdown input passed (instead of one per line)
# – do not choke on shell escape characters (use Tempfile instead of shell pipe for osascript)
# – default to MultiMarkdown 3 executable (instead of MMD 2 Perl script)
# – make smart typography processing optional (set SMARTY to 'false' to bypass processing;
# note smart typography cannot be disabled in MMD 3.0 and 3.0.1
# – handle both smart typography processing scripts (ie. SmartyPants.pl)
@phaer
phaer / raw_tag.rb
Created June 11, 2011 19:11
Raw tag for jekyll. Keeps liquid from parsing text betweeen {% raw %} and {% endraw %}
module Jekyll
class RawTag < Liquid::Block
def parse(tokens)
@nodelist ||= []
@nodelist.clear
while token = tokens.shift
if token =~ FullToken
if block_delimiter == $1
end_tag
/*
* Customize Footnotify on your site by adding custom css.
*
* This file is NOT loaded by the script and must be
* implemented on the site in order to apply.
*
* More info: https://gist.github.com/1046538
*
*/