Skip to content


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.

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
# Echo all 256 tput foreground colors
for i in {0..255}
echo "$(tput setaf $i)$i: The quick brown fox jumps over the lazy dog.$(tput sgr0)"
View inspector.html
<!doctype html>
<title>Inspector: Loader Test</title>
body { font: 13px Arial; }
.error { color: #f00; }
<body class="yui3-skin-sam">
View gist:943498
* 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
#!/usr/bin/env ruby
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.
View index.html
<!doctype html>
<title>Duck punch Node.scrubVal's inability to handle empty arrays</title>
View gist:586509
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
# 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
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.