Brett Stimmerman brettstimmerman

View README.md

Bindception

Use Function.prototype.bind to debug Function.prototype.bind.

The Problem

Debugging functions created with Function.prototype.bind is not easy. Calling toString on a bound function gives only 'function () { [native code] }', and the details of the binding are buried inside and unavailable.

View multilinejs.py
1 2 3 4 5 6 7 8 9
import sublime
import sublime_plugin
import re
 
'''
SublimeText 2 plugin to convert selections (or the entire document) to a
JavaScript multiline string using the [].join('\n') idiom.
 
Given a document like:
View gist:3711302
1 2 3 4 5
# Echo all 256 tput foreground colors
for i in {0..255}
do
echo "$(tput setaf $i)$i: The quick brown fox jumps over the lazy dog.$(tput sgr0)"
done
View inspector.html
1 2 3 4 5 6 7 8 9 10
<!doctype html>
<html>
<head>
<title>Inspector: Loader Test</title>
<style>
body { font: 13px Arial; }
.error { color: #f00; }
</style>
</head>
<body class="yui3-skin-sam">
View gist:943498
1 2 3 4 5 6 7 8 9 10
/**
* Load a YUI Gallery module locally for testing.
*
* Assumes you've built your module with ant and have a local copy of the
* yui3-gallery repo.
*
* This will override Loader's Gallery configuration. Existing Gallery modules
* will load locally, and your new module should load locally as well.
*
* Props to Caridy for helping piece this together.
View svn-slog
1 2 3 4 5 6 7 8 9 10 11
#!/usr/bin/env ruby
 
trap(:SIGINT){}
 
opts = {}
pattern = []
help = <<HELP
svn-slog filters output from `svn log`. It reads standard input if given,
otherwise `svn log` is run in the background.
svn-slog filters output from `svn log`. It reads standard input if given,
otherwise `svn log` is run in the background.
View index.html
1 2 3 4 5 6 7 8 9 10
<!doctype html>
<html>
<head>
<title>Duck punch Node.scrubVal's inability to handle empty arrays</title>
</head>
<body>
<ul>
<li>One</li>
<li>Two</li>
<li>Three</li>
View gist:586509
1 2 3 4 5 6 7 8 9 10
/*
This Vows test suite produces the following spec output with vows 0.5.1 and
node 0.2.1.
 
Emitter
 
A NonEmitter does not inherit from EventEmitter
and can be tested
 
Errored » Emitter: An Emitter inherits from EventEmitter not fired!
View gist:382508
1 2 3 4 5 6 7 8 9 10
# Returns (svn:<revision>:<branch|tag>[*]) if applicable
svn_prompt() {
if [ -d ".svn" ]; then
local branch dirty rev info=$(svn info 2>/dev/null)
branch=$(svn_parse_branch "$info")
# Uncomment if you want to display the current revision.
#rev=$(echo "$info" | awk '/^Revision: [0-9]+/{print $2}')
View rssfeed.php
1 2 3 4 5 6 7 8 9 10
<?php
function getItems() {
$items = array();
// Get items from somewhere
return $items;
}
 
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
?>
<rss version="2.0">
Something went wrong with that request. Please try again.