Skip to content

Instantly share code, notes, and snippets.

KPKNRKLPKLR4
A47FRMJWLMX4
3PMKAYXMK3KJ
4KTMT4AA94F6
6WHJ7HYJJ4KF
KX6YNA4WFTE9
NT9MY43RXLAE
FMPW9RLL9YKL
YEN9HM9WXPMN
PRR7RYJ3J9HW
@stammy
stammy / launch_term_tabs.scpt
Created October 14, 2010 22:15
Launch a series of commands in new OS X Terminal tabs
-- How to use: you can either run manually in applescript editor or open Automator
-- and select run applescript and paste this code where it tells you
-- then save that automation as an application. pro tip: go to sys prefs, accounts, login items
-- and add it there to launch on boot :)
-- provide the commands you want to open here.
-- want to run multiple in the same tab? just use a semicolon to separate the commands
-- these are just dummy commands. i usually launch redis-server, tail my error log, launch sass, and do a git status on my project dir
require 'fileutils'
start_time = Time.now
SOURCE_DB = {
:name => 'db_name',
:user => 'db_user',
:password => 'db_pass',
:host => 'localhost'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>bundleUUID</key>
<string>C9BD1ADE-4FD9-4842-A641-DFB373B7D42C</string>
<key>command</key>
<string>#!/usr/bin/env ruby
@stammy
stammy / .htaccess
Created December 31, 2010 04:28 — forked from henrik/.htaccess
RewriteEngine On
# Map http://henrik.nyh.se to /jekyll.
RewriteRule ^$ /jekyll/ [L]
# Map http://henrik.nyh.se/x to /jekyll/x unless there is a x in the web root.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/jekyll/
RewriteRule ^(.*)$ /jekyll/$1
@stammy
stammy / Rakefile
Created January 22, 2011 02:03
Goes in Rakefile for Jekyll for those wanting tag pages
# Using multi-word tags support from http://tesoriere.com/2010/08/25/automatically-generated-tags-and-tag-clouds-with-jekyll--multiple-word-tags-allowed-/
# If using with jekyll gem, remove bits loop and site.read_bits('') and add require 'rubygems' and require 'jekyll'
# Using full HTML instead of layout include to manually set different page title (tag, not tag_slug) and canonical URL in header
desc 'Build tags pages'
task :build_with_tags do
sh 'rm -rf _site'
puts "Generating tags..."
@stammy
stammy / archives.html
Created January 22, 2011 02:17
Jekyll archives.html page
---
layout: default
title: Archives
---
<div id="post">
<h1>Archives</h1>
<p>All posts can be found on this page or by <a href="{{site.base_url}}/search" title="Search">searching</a>. Bits (short-form pieces) are not included here and have <a href="{{site.base_url}}/bits" title="Bits">their own section</a>.</p><br/>
{% for year in (2005..2015) reversed %}
@stammy
stammy / wordpress_importer.rb
Last active March 27, 2022 09:39
Import a WordPress database and generate markdown files for Jekyll
# View my Jekyll blog http://paulstamatiou.com and my jekyll migration post http://paulstamatiou.com/how-to-wordpress-to-jekyll/
#
#
# based on the import script by icebreaker, which is based on mojombo's
# https://github.com/mojombo/jekyll/blob/master/lib/jekyll/migrators/wordpress.rb
# https://gist.github.com/303570
# edited to rewrite image URLs to use my CloudFront URL
require 'rubygems'
require 'sequel'
@stammy
stammy / Rakefile
Created January 22, 2011 10:28
dirty hack of a rakefile I use to upload new images to cloudfront for jekyll blog posts
# 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
@stammy
stammy / Rakefile
Created January 24, 2011 08:01
rake task for creating a new jekyll post.
# ignore the "bit" stuff.. only relevant to my custom jekyll fork
desc 'create new post or bit. args: type (post, bit), title, future (# of days)'
# rake new type=(bit|post) future=0 title="New post title goes here" slug="slug-override-title"
task :new do
require 'rubygems'
require 'chronic'
type = ENV["type"] || "bit"
title = ENV["title"] || "New Title"