Skip to content

Instantly share code, notes, and snippets.

git-sed () {
git grep -l "$1" | xargs sed -i "" "s/$1/$2/g"
}
  • wcd
  • karma-android-launcher
  • blog
  • links
  • music
package main
import (
"io"
"io/ioutil"
"net/http"
"os"
"strings"
)
// super naive get xhr/promise implementation only tested in chrome
function req(url) {
var x = new XMLHttpRequest();
var success;
var done;
x.onreadystatechange = function () {
if (x.readyState === 4) {
done = JSON.parse(x.responseText);
if (typeof success === 'function') success(done);
<!doctype html>
<script>
var cache = {};
function define(thing, fn) {
cache[thing] = fn;
}
node_modules
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'json'
require 'cgi'
require 'find'
require 'net/http'
class Movie
$(function() {
$('a[id$="mainLink"]').attr("rel", "#overlay").overlay({
effect: 'apple',
onBeforeLoad: function() {
var linkEl = this.getOverlay().find("#passthrough"),
link = this.getTrigger().attr("href"),
iframe = this.getOverlay().find("#iframe");
@danshearmur
danshearmur / gist:994931
Created May 27, 2011 09:28
Redirect to correct domain in IIS
<!--
- Redirect to correct domain in IIS
- Useful if you have more than one domain
- for example: maindomain.com, maindomain.co.uk, www.maindomain.co.uk, testingdomain.dev
- inspired by https://github.com/paulirish/html5-boilerplate-server-configs/blob/master/web.config#L192
-->
<rewrite>
<rules>
<rule name="Correct Domain" stopProcessing="true">
@danshearmur
danshearmur / gist:994979
Created May 27, 2011 09:59
Weird IIS 404s
<!--
- Everything in "/Files/" was 404'ing. copied files to "/legacy/" and made this
-->
<rule name="files_folder" stopProcessing="true">
<match url="^Files/(.*)$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="legacy/{R:1}" />