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
javascript:(function({ | |
var INSTAPAPER=true,w=window,d=document,pageSelectedTxt=w.getSelection?w.getSelection():(d.getSelection)?d.getSelection():(d.selection?d.selection.createRange().text:0),pageTitle=d.title,pageUri=w.location.href,tmplt=""; | |
tmplt="From ["+pageTitle+"]("+pageUri+"):\n\n"; | |
if(pageSelectedTxt!="") { | |
pageSelectedTxt=">%20"+pageSelectedTxt; | |
pageSelectedTxt=pageSelectedTxt.replace(/(\r\n|\n+|\r)/gm,"\n"); | |
pageSelectedTxt=pageSelectedTxt.replace(/\n/g,"\n>%20\n>%20"); | |
w.location.href="nvalt://make/?txt="+encodeURIComponent(tmplt+pageSelectedTxt)+"&title="+encodeURIComponent(pageTitle) | |
} | |
else { |
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 'cgi' | |
require 'digest/md5' | |
require 'net/https' | |
require 'uri' | |
module Jekyll | |
class GistTag < Liquid::Tag | |
def initialize(tag_name, text, token) | |
super | |
@text = text |
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 "jammit" | |
module Jekyll | |
class JammitGenerator < Generator | |
safe true | |
def generate(site) | |
jammit_config = site.config["jammit_config"] || "_assets.yml" | |
jammit_base_dir = site.config["jammit_base_dir"] || File.join(".", site.config["source"]) | |
jammit_output_dir = site.config["jammit_output_dir"] || "assets" |
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
# when I write new blog posts I usually have a temporary folder called new_post on my desktop | |
# that I place images I want to upload to amazon s3 (which is distributed as CF) and then | |
# get the appropriate URLs to put the images in my blog post | |
# I usually save files as some_slug.png and some_slug_1200.png | |
# with the latter being a larger version (1200px wide) of the first. | |
# a typical upload will include 20 files. 2 versions of some (sm and lg), and some orphans | |
# so this compares filenames and if it detects a larger version of a file, | |
# it links the the smaller image to the larger image (i use fancyzoom on my site) | |
# if not, it just links to the image |
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 ruby | |
# | |
# Convert blogger (blogspot) posts to jekyll posts | |
# | |
# Basic Usage | |
# ----------- | |
# | |
# ./blogger_to_jekyll.rb feed_url | |
# | |
# where `feed_url` can have the following format: |
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
# Want to show hidden files and folders in your TextMate project drawer? Simple, just modify the file and folder patterns in TextMate's preferences. | |
# Instructions: | |
# Go to TextMate > Preferences... | |
# Click Advanced | |
# Select Folder References | |
# Replace the following: | |
# File Pattern |
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 sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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
doctype html | |
/[if lt IE 7] | |
html.no-js.ie6.oldie lang="en" | |
/[if IE 7] | |
html.no-js.ie7.oldie lang="en" | |
/[if IE 8] | |
html.no-js.ie8.oldie lang="en" | |
/[if gte IE 8] | |
html.no-js lang="en" | |
head |
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
# TextMate dotfiles filter | |
# use this filter in Preferences -> Advanced -> Folder References -> File Pattern | |
# to show .gitignore, .gems (useful for Heroku), .bundle in your project | |
!(/\.(?!(htaccess|gitignore|gems|bundle))[^/]*|\.(tmproj|o|pyc)|/Icon\r|/svn-commit(\.[2-9])?\.tmp)$ |
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 goes in _plugins/excerpt.rb | |
module Jekyll | |
class Post | |
alias_method :original_to_liquid, :to_liquid | |
def to_liquid | |
original_to_liquid.deep_merge({ | |
'excerpt' => content.match('<!--more-->') ? content.split('<!--more-->').first : nil | |
}) | |
end | |
end |