This file contains 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
function eachAsync(collection, iterator, callback) { | |
var iterate = function(i) { | |
setTimeout(function() { | |
iterator(collection[i]); | |
if (i < collection.length) { | |
iterate(i + 1); | |
} else { | |
callback(); | |
} | |
}, 0); |
This file contains 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
#threadTree treechildren { | |
font-size: 16pt; | |
} | |
#threadTree treechildren:-moz-tree-row { | |
border-bottom: 1px solid #E1E1E1; | |
height: 20pt !important; | |
} |
This file contains 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
function throttle(callback, delay, before) { | |
var busy = false; | |
var hold = false; | |
function callAfterDelay(self, args) { | |
setTimeout(function() { | |
if (hold) { | |
hold = false; | |
callAfterDelay(self, args); | |
return; |
This file contains 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
Show hidden characters
[ | |
{ "keys": ["ctrl+alt+r"], "command": "randomize" } | |
] |
This file contains 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
import sublime | |
import sublime_plugin | |
class NumberCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
selection = self.view.sel() | |
for region in selection: | |
try: | |
value = int(self.view.substr(region)) | |
self.view.replace(edit, region, str(self.op(value))) |
This file contains 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
(function() { | |
function expand($) { | |
function text($element) { | |
return $.trim($element.clone().children().remove().end().text()); | |
} | |
function isFixedOrFloating($element) { | |
try { | |
if ($element.css("position") === "fixed") { | |
return true; |
This file contains 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
public static class EvilStringHelper | |
{ | |
private static readonly Action<string, int, char> _setChar; | |
private static readonly Action<string, int> _setLength; | |
static EvilStringHelper() | |
{ | |
if (Environment.Version.Major < 4) | |
{ | |
MethodInfo setCharMethod = typeof(string).GetMethod( |
This file contains 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
using System; | |
using System.Text; | |
namespace FastStringConcatenation | |
{ | |
public class FastString | |
{ | |
const int DefaultCapacity = 32; | |
readonly StringBuilder buffer; |
This file contains 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
# Disable XML parameter parsing completely as a stopgap measure until upgrading to Rails 2.3.16 | |
# to defend against arbitrary code execution vulnerability; see: | |
# https://groups.google.com/forum/#!topic/rubyonrails-security/61bkgvnSGTQ/discussion | |
ActionController::Base.param_parsers.delete(Mime::XML) |
This file contains 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
function Agent(name) { | |
this.name = name; | |
this.command = function(subordinate, description, instructions) { | |
console.log(this.name + " tells " + subordinate.name + ": '" + description + "'"); | |
instructions.apply(subordinate); | |
}; | |
this.getCoffee = function() { | |
var recipients = Array.prototype.slice.call(arguments); |
OlderNewer