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
#!/usr/bin/env ruby | |
# | |
# textile+lhs2html | |
# | |
# A script for transforming Literate Haskell | |
# with Textile-formatted text to HTML with | |
# the help of Ruby and RedCloth. | |
# | |
# Written by Christoffer Sawicki in 2009. | |
# Released into the public domain. |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'nokogiri' | |
XSL = <<-EOXSL | |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:output method="xml" encoding="ISO-8859-1"/> | |
<xsl:param name="indent-increment" select="' '"/> |
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 | |
# http://colordiff.sourceforge.net/ | |
if tty -s; then | |
exec svn diff --diff-cmd=colordiff "$@" | less -R | |
else | |
exec svn diff --diff-cmd=colordiff "$@" | |
fi |
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
#!/usr/bin/env ruby | |
ARGV.each do |arg| | |
name, line = arg.split(":") | |
system("mate", name, "--line", line) | |
end |
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
#lang racket ; Requires Racket >= 5.1.1 | |
(provide (rename-out (objective-r-read read) | |
(objective-r-read-syntax read-syntax))) | |
(require syntax/stx) | |
(define (rewrite-method-calls stx) | |
(if (stx-list? stx) | |
(let ((stx* (stx-map rewrite-method-calls stx))) |
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
(ns ring.middleware.x-forwarded-for | |
(:use [clojure.string :only (split)])) | |
(defn wrap-x-forwarded-for [handler] | |
(fn [request] | |
(if-let [xff (get-in request [:headers "x-forwarded-for"])] | |
(handler (assoc request :remote-addr (last (split xff #"\s*,\s*")))) | |
(handler request)))) |
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
user=> (use 'clojure.walk) | |
nil | |
user=> (macroexpand-all '(-> x (1 a) (2 b))) | |
(2 (1 x a) b) | |
user=> (macroexpand-all '(->> x (1 a) (2 b))) | |
(2 b (1 a x)) |
- The entry titles are sometimes picked very badly. Examples:
URL | Expected Title | Title in Pocket |
---|---|---|
http://lambda-the-ultimate.org/node/4728 | Typesafe Activator | Lambda the Ultimate |
http://adafruit.com/products/609 | NeTV Starter Pack ID: 609 - $119.00 | $119.00 |
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
; Context: | |
; http://stackoverflow.com/questions/3436216/how-to-map-clojure-code-to-and-from-json | |
(defn escape-string [x] | |
(clojure.string/replace x #"^[':\\]" "\\\\$0")) | |
(defn code-to-json [x] | |
(condp #(%1 %2) x | |
number? x | |
symbol? (str \' (name x)) |
OlderNewer