Skip to content

Instantly share code, notes, and snippets.

View xwmx's full-sized avatar

William Melody xwmx

View GitHub Profile
require 'net/dns/resolver'
# Custom Domain
#
# Require net-dns gem
#
# A Rack middleware to to resolve the custom domain to original subdomain
# for your multi telent application.
#
# It's all transperant to your application, it performs cname lookup and
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">@import 'doc.css';</style>
<div id='potion'><img src='potion-1.png' /></div>
</head><body><div id='central'>
<h1 class="kana">ポーション</h1>
<h1>A Short Pamphlet</h1>
<h4>by why the lucky stiff</h4>
<p>Well, here we go. You want to learn Potion<sup class="footnote"><a href="#fn1">1</a></sup>? Sure, okay. But first, bear in mind that Potion isn&#8217;t done yet. And it does very little. It&#8217;s completely esoteric. So long as we&#8217;ve got that straight.</p>
" Vim color file
" eclips3remix v0.1
" eclips3remix -
" vim version of the eclips3media textmate theme
" cool help screens
" :he group-name
" :he highlight-groups
def fib(n):
if n == 0 or n == 1:
return n
else:
return fib(n-1) + fib(n-2)
for i in range(36):
print "n=%d => %d" % (i, fib(i))
# Python 2.5.4
# browsing of shared dvds/cds on leopard
defaults write com.apple.NetworkBrowser EnableODiskBrowsing -bool true
defaults write com.apple.NetworkBrowser ODSSupported -bool true
#! /bin/sh
# http://kbeezie.com/view/nginx-and-django/
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
@xwmx
xwmx / info
Created November 22, 2009 19:23 — forked from mikeal/large_doc.json
http://www.mikealrogers.com/archives/695
http://gist.github.com/239890
module HTML
class StathamSanitizer < WhiteListSanitizer
protected
def tokenize(text, options)
super.map do |token|
if token.is_a?(HTML::Tag) && options[:parent].include?(token.name)
token.to_s.gsub(/</, "&lt;")
else
We couldn’t find that file to show.
# converts sections to chapters, subsections to sections and subsubsections to subsections after processing with pandoc.
$ pandoc -t latex -C TeXHeader -s Chapter1 Chapter2 | sed -e 's/\
\section{/\\chapter{/g' \
-e 's/subsection{/section{/g' > book.tex
$ pdflatex book.tex