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
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 |
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
#!/bin/zsh | |
# This script deletes the least-recently used (LRU) files from Polipo's cache | |
# once the partition it is on has less than $min_disk_free Bytes of free space | |
# left. | |
# | |
# It's meant to be used as a cron job, and it's a little more complicated than | |
# it needs to be, because I wrote it mostly to learn zsh. | |
local cache_dir="/var/cache/polipo/" |
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
;; Automatically add, commit, and push when files change. | |
(defvar autocommit-dir-set '() | |
"Set of directories for which there is a pending timer job") | |
(defun autocommit-schedule-commit (dn) | |
"Schedule an autocommit (and push) if one is not already scheduled for the given dir." | |
(if (null (member dn autocommit-dir-set)) | |
(progn | |
(run-with-idle-timer |
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
<? | |
// Twitter self-hosted image service/url shortener by Ryan Petrich | |
// Installation: | |
// 1. Paste this script into the top of your HTTP root's index.php (rename index.html to index.php if it doesn't exist) | |
// 2. Add the following to your HTTP root's .htaccess file (create .htaccess if it doesn't exist): | |
// ErrorDocument 404 /index.php | |
// 3. Create a "s" subfolder and give it 777 permissions | |
// 4. Add the following as the custom URL for URL shortening in Twitter for iPhone's settings: | |
// http://yourdomain.com/?d=%@&p=password | |
// 5. Add the following as the custom URL for Image service: |
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
var http = require("http"), | |
url = require("url"), | |
path = require("path"), | |
fs = require("fs") | |
port = process.argv[2] || 8888; | |
http.createServer(function(request, response) { | |
var uri = url.parse(request.url).pathname | |
, filename = path.join(process.cwd(), uri); |
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
<!DOCTYPE html> | |
<head> | |
<title>Stay Standalone</title> | |
<meta name="apple-mobile-web-app-capable" content="yes"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> | |
<script src="stay_standalone.js" type="text/javascript"></script> | |
</head> | |
<body> | |
<ul> | |
<li><a href="http://google.com/">Remote Link (Google)</a></li> |
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
#!/bin/sh | |
# Just copy and paste the lines below (all at once, it won't work line by line!) | |
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY! | |
function abort { | |
echo "$1" | |
exit 1 | |
} | |
set -e |
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
function hideAddressBar() | |
{ | |
if(!window.location.hash) | |
{ | |
if(document.height < window.outerHeight) | |
{ | |
document.body.style.height = (window.outerHeight + 50) + 'px'; | |
} | |
setTimeout( function(){ window.scrollTo(0, 1); }, 50 ); |
OlderNewer