Skip to content

Instantly share code, notes, and snippets.

@henrik
henrik / wordpress.rb
Created April 22, 2009 22:33
Standard Jekyll WordPress import script modified for tags and some custom fixups.
require 'rubygems'
require 'sequel'
require 'fileutils'
require 'cgi'
# NOTE: This converter requires Sequel and the MySQL gems.
# The MySQL gem can be difficult to install on OS X. Once you have MySQL
# installed, running the following commands should work:
# $ sudo gem install sequel
# $ sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
@jrk
jrk / newpost.rb
Created May 5, 2009 06:48 — forked from al3x/newpost.rb
Creates a new Jekyll post, opens it in TextMate, and adds to the git index
#!/usr/bin/env ruby
require Dir
unless ARGV[0]
puts 'Usage: newpost "the post title"'
exit(-1)
end
blog_root = "/Users/jrk/proj/blog"
@smajda
smajda / aggregate-feed.php
Created October 7, 2009 16:41
Merge multiple RSS feeds with SimplePie
<?php
/* Merge multiple RSS feeds with SimplePie
*
* Just modify the path to SimplePie and
* modify the $feeds array with the feeds you want
*
* You should probably also change the channel title, link and description,
* plus I added a CC license you may not want
*
* Help from: http://www.webmaster-source.com/2007/08/06/merging-rss-feeds-with-simplepie/
@jrk
jrk / redis-server-for-init.d-startup
Created January 25, 2010 17:00 — forked from mtodd/redis-server-for-init.d-startup
init.d script for redis server
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
# PROBLEM: when someone replies to you publicly in an IRC channel you may not be
# notified of it if you are away from your computer. The common format for public
# replies looks like this:
#
# <jchris> maxo_: yeah mine is way better
#
# SOLUTION: Sign up for notifo as both a supplier and a consumer, and install the
# notifo app on your smartphone. Execute this in cron every minute to have new
# mentions sent to your phone as push notifications.
#
<?php
/*
Easy to use sms notifications from Notifo
Super quick hack by Harper - @harper - harper@nata2.org
First:
--------------
Get Google-Voice-PHP-API:
<?php
class Notifo_API {
const API_ROOT = 'https://api.notifo.com/';
const API_VER = 'v1';
protected $apiUsername;
protected $apiSecret;
@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'
@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