This file contains hidden or 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
/* | |
* Extend JavaScript String object with printf() like functionality | |
* "{0} is dead, but {1} is alive!".format("This", "that"); | |
*/ | |
String.prototype.format = function() { | |
var formatted = this; | |
for(arg in arguments) { | |
formatted = formatted.replace("{" + arg + "}", arguments[arg]); | |
} | |
return formatted; |
This file contains hidden or 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 node | |
/** | |
* Node.js Async I/O POC [equivalent of wc -l filename] | |
* Run me: node wc.js [filename] | |
*/ | |
var sys = require('sys'), | |
fs = require('fs'); |
This file contains hidden or 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
$(document).ready(function() { | |
$.ajax({ | |
type: 'GET', | |
url: 'query/', | |
data: ({ | |
type: 'responses', | |
limit: 5000, | |
order: 'asc' | |
}), | |
dataType: 'json', |
This file contains hidden or 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
learn.html | |
An annotated guide to basic HTML. | |
Created by Fredrick Galoso (Updated 2011-06-24) | |
Public domain, but I'd love some credit. Remix, add, enjoy. | |
<!----> Are comments. |
This file contains hidden or 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
--- pyinotify.py.orig 2011-06-26 12:57:41.000000000 +0100 | |
+++ pyinotify.py.new6 2011-06-26 17:17:56.000000000 +0100 | |
@@ -69,6 +69,7 @@ | |
import re | |
import asyncore | |
import glob | |
+import hashlib | |
try: | |
from functools import reduce |
This file contains hidden or 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
$ ab -n 1000 -c 250 http://ec2-xx-xx-xx-xx.compute-1.amazonaws.com/ | |
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking ec2-xx-xx-xx-xx.compute-1.amazonaws.com (be patient) | |
Completed 100 requests | |
Completed 200 requests | |
Completed 300 requests |
This file contains hidden or 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/local/bin/ruby | |
require 'AWS' | |
require 'yaml' | |
class SnapshotManagement | |
# initalize class, optional override path to yml file | |
# * options [String] :path ('') | |
# | |
def initialize(params = {}) |
This file contains hidden or 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 | |
### BEGIN INIT INFO | |
# Provides: mongodb | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the mongodb data-store | |
# Description: starts mongodb using start-stop-daemon |
This file contains hidden or 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
# See: http://bugs.python.org/issue10976 | |
EEEEEEE | |
====================================================================== | |
ERROR: test_database_exists (__main__.testSeat) | |
Database exists | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/usr/local/lib/python3.1/dist-packages/seat.py", line 86, in __send | |
result = json.loads(request.read()) | |
File "/usr/lib/python3.1/json/__init__.py", line 291, in loads |
This file contains hidden or 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
/** | |
* Inspired by http://d24w6bsrhbeh9d.cloudfront.net/photo/172219_460s.jpg | |
*/ | |
function Understand() { | |
this.this = 'loser'; | |
} | |
function A() { | |
this.girlfriend = true; |