Skip to content

Instantly share code, notes, and snippets.

View fearphage's full-sized avatar
⌨️
Cache rules everything around me.

Phred Lane fearphage

⌨️
Cache rules everything around me.
View GitHub Profile
@brianloveswords
brianloveswords / get-http-codes.sh
Created August 26, 2011 07:36
bash: get http response codes for a list of URLs
#!/bin/bash
# from http://www.hilarymason.com/blog/bash-get-http-response-codes-for-a-list-of-urls/
while read line
do
echo $(curl --write-out %{http_code} --silent --output /dev/null $line)
done <$1
@terrycojones
terrycojones / gist:1140581
Created August 11, 2011 19:53
deferred memoizer
from twisted.internet import defer, fail, succeed
from twisted.python import failure
class DeferredMemoizer(object):
def __init__(self, func):
self._func = func
self._pool = {}
self._results = {}
@kangax
kangax / gist:1032025
Created June 17, 2011 18:48
IE9 developer tools annoyances
  1. Can't debug in minimized pane

  2. console.log(1, 2, 3) shows 123 (not 1 2 3)

  3. console.log(undefined, "undefined") shows undefinedundefined. Ditto for null and "null"

  4. Object properties that are on prototype chain are displayed in console (e.g. console.log("foo") displays object with anything defined on String.prototype)

  5. Can't inspect logged object (by clicking on it) [CLOSED BY DESIGN]

@eliperelman
eliperelman / LICENSE.txt
Created June 17, 2011 15:37 — forked from 140bytes/LICENSE.txt
140byt.es polyfill for Array.filter
DO WHAT THE **** YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Eli Perelman http://eliperelman.com
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE **** YOU WANT TO PUBLIC LICENSE
@cwestin
cwestin / aggregate.js
Created May 26, 2011 18:34
Mongo shell script and sample documents used for my aggregation talk at MongoSF
/* sample aggregate command queries */
// make sure we're using the right db; this is the same as "use mydb;" in shell
db = db.getSisterDB("aggdb");
// just passing through fields
var p1 = db.runCommand(
{ aggregate : "article", pipeline : [
{ $project : {
tags : 1,
pageViews : 1
@schacon
schacon / gist:942899
Created April 26, 2011 19:19
delete all remote branches that have already been merged into master
$ git branch -r --merged |
grep origin |
grep -v '>' |
grep -v master |
xargs -L1 |
awk '{split($0,a,"/"); print a[2]}' |
xargs git push origin --delete
@brianleroux
brianleroux / phonegap-pyside.py
Created April 11, 2011 20:07
A quick, rather goofy, desktop WebKit wrapper w/ Qt/Pyside.
#! /usr/bin/env python
import sys
import os
from PySide.QtCore import *
from PySide.QtGui import *
from PySide.QtWebKit import *
app = QApplication(sys.argv)
app.setQuitOnLastWindowClosed(True)
@mlouro
mlouro / JSHINT Node.js app
Created April 1, 2011 15:19
JSHINT Node.js app and rules
var express = require('express')
var app = express.createServer();
var JSHINT = require('jshint').JSHINT;
app.use(express.bodyParser());
app.get('/', function(req, res){
res.send('hello world');
});
@cosimo
cosimo / purge-cache.sh
Created March 28, 2011 09:51
Script to purge varnish cache by URL, by regexp or all of it (for Debian)
#!/bin/sh
# purge-cache: Script to purge varnish cache. Defaults are defined in
# /etc/default/varnish.
#
# Cosimo <[email protected]>
# Based on reload-vcl, by Stig Sandbeck Mathisen <ssm at debian dot org>
# Settings
defaults=/etc/default/varnish
@heapwolf
heapwolf / UIFail.md
Created March 24, 2011 14:50
IE9/Safari UI Fail.

Your design is wrong.

I want to preface this rant. I appreciate diversity and competition. Also, I'm not just an MS or Apple hater. If they make a great product I'll consider using it. I try to look past brands and use products that solve problems well.

The IE9/Safari UI fail.

UI design is all about disclosing information. Shapes, proportions, perspectives, colors, reactions and transformations! There are infinite ways to go about expressing ideas when speaking the language of design. In order to prevent a colosal goat fuck of a UI, each expression must be executed judiciously.