Skip to content

Instantly share code, notes, and snippets.

@sskylar
sskylar / import-siteleaf.json
Last active December 18, 2015 18:10
Siteleaf import script. Imports a JSON dump of blog posts into a Siteleaf page. Requires the Siteleaf Gem (https://github.com/siteleaf/siteleaf-gem). Run in the command line using "ruby import-siteleaf.rb".
[{
"title":"Post 1",
"body":"Body goes here.",
"tags":["Tag 1", "Tag 2"],
"slug":"post-1",
"published_at":"2013-06-05T18:24:59-04:00"
}, {
"title":"Post 2",
"body":"Body goes here.",
"tags":["Tag 1", "Tag 2"],
@bradleyboy
bradleyboy / nginx.conf
Last active March 22, 2022 19:46
nginx rewrite setup for Koken
# Enable gzip. Highly recommending for best peformance
gzip on;
gzip_comp_level 6;
gzip_types text/html text/css text/javascript application/json application/javascript application/x-javascript;
# By default, do not set expire headers
expires 0;
# Set expires header for console CSS and JS.
# These files are timestamped with each new release, so it is safe to cache them agressively.
@simplicitybliss
simplicitybliss / Add Last Email Sent to OmniFocus.applescript
Last active June 1, 2020 14:12
Short AppleScript that adds the last email sent in Mail.app to the OmniFocus Inbox as a task
(*
Add last sent email to OmniFocus Script
by simplicitybliss.com, Sven Fechner
Straight forward script that sends the last email sent in Mail.app to OmniFocus either using the Quick Entry window or silently (well, with Growl based notifications if desired) straight to the Inbox.
You can influence how the task is named by modifying the PreFix and MidFix properties. The note of the task will contain a link back the email in Mail.app.
Use the AppleScript Menu or tools likle FastScripts, Launchbar or Alfred to trigger the script.
@ttscoff
ttscoff / 5by5 Episode Link Grabber.md
Last active December 11, 2015 02:19
Browser bookmarklet which generates a Markdown list of all the show links on a 5by5 episode page, autoselects the result for copying and provides next/prev navigation
@marijnvdwerf
marijnvdwerf / gist:2399778
Created April 16, 2012 16:25
Kirby CMS Nginx config?
location / {
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php last;
break;
}
}
@imathis
imathis / gist:1104557
Created July 25, 2011 16:49
FIX for Lion's posix_spawn_ext.bundle: [BUG] Segmentation fault

The segfault problem with posix_spawn is indeed caused by Lion's compiler being LLVM and not GCC by default. However, when I installed RVM, the notes suggested that on Lion you need to add export CC=/usr/bin/gcc-4.2 to your shell startup file (.bashrc or .zshrc as appropriate). I did that, but it seems that's what caused problems: while ruby 1.9.2 needs you to use GCC to install it, using the same compiler for the gems apparently causes breakage.

First, you need to install XCode 4.x, which is now a free (though hefty!) download from the Mac App Store. Without that, you have no gcc, so you won't get anywhere ;-)

Next, what you need to do is clear out your rvm ruby and the associated gems (make sure you are cd'd into your octopress repository then do:

rvm remove ruby-1.9.2 --gems --archive

which will clear everything out so that you can start from scratch. Obviously, if you have other stuff you've installed for other purposes using RVM, be careful with this. If you previously had the export CC li

# Import a posterous.com Blog into nanoc (http://nanoc.stoneship.org)
# Uses Nokogiri to parse the XML data from the posterous API
require 'rubygems'
require 'nanoc3'
require 'nokogiri'
require 'open-uri'
module Nanoc3::Extra
module Importers
@pstinnett
pstinnett / ee_disqus_exporter.rb
Created December 30, 2009 18:07 — forked from shapeshed/ee_disqus_exporter.rb
ExpressionEngine comments to Disqus ruby script
# Copyright 2009 Michael Ivey, released to public domain
# Disqus guts lifted from http://github.com/squeejee/disqus-sinatra-importer/tree/master
# I wanted it to run from MySQL and command line, instead of a Sinatra app
require 'rubygems'
require 'rest_client'
require 'json'
require 'sequel'
disqus_url = 'http://disqus.com/api'