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
Intel Core 2 Quad E6700 @ 3.00 | |
8 GB ram | |
Ubuntu 10.10 | |
100k iterations | |
CPython 2.6.6 | |
100.508443832 | |
101.226439953 |
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
/** | |
* npm install jsdom | |
* npm install jquery | |
*/ | |
var html = "<!doctype html><html><body><h1>Hello world!</h1></body></html>"; | |
/* parse the html and create a dom window */ | |
var window = require('jsdom').jsdom(html, null, { | |
// standard options: disable loading other assets |
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 median(values) { | |
values.sort( function(a,b) {return a - b;} ); | |
var half = Math.floor(values.length/2); | |
if(values.length % 2) | |
return values[half]; | |
else | |
return (values[half-1] + values[half]) / 2.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
// Replace refToObject in node-inspector's lib/sessions.js file to get rid of the 80 character limit on strings outputted from the console or tool tip. | |
// The Scope Variables panel will still show maximum of 80 characters along with the "(length: x)" suffix | |
function refToObject(ref) { | |
var desc = '', | |
name, | |
kids = ref.properties ? ref.properties.length : false; | |
switch (ref.type) { | |
case 'object': | |
name = /#<an?\s(\w+)>/.exec(ref.text); |
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
/*global module:false*/ | |
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
min: { | |
ariaAccessibility: { | |
src: ['src/javascripts/jquery.selectBoxIt.ariaAccessibility.js'], | |
dest: 'src/javascripts/jquery.selectBoxIt.ariaAccessibility.min.js' | |
}, |
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 isAnimatedGif(src, cb) { | |
var request = new XMLHttpRequest(); | |
request.open('GET', src, true); | |
request.responseType = 'arraybuffer'; | |
request.addEventListener('load', function () { | |
var arr = new Uint8Array(request.response), | |
i, len, length = arr.length, frames = 0; | |
// make sure it's a gif (GIF8) | |
if (arr[0] !== 0x47 || arr[1] !== 0x49 || |
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
Host * | |
# don't try to authenticate with Kerberos | |
GSSAPIAuthentication no | |
GSSAPIKeyExchange no | |
# persist the ssh connection for 5 minutes | |
# subsequent ssh connections respond faster because its reusing an existing connection | |
ControlMaster auto | |
ControlPath ~/.ssh/master-%r@%h:%p | |
ControlPersist 5m |
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
// Metrobone.js 0.0.1 | |
// | |
// J.R. Tipton @jrtipton | |
// Metrobone is a wimpy little utility library for | |
// making Backbone.js integrate with WinJS controls | |
// (for Windows 8 development) a little easier. | |
// | |
// Two basic ways to use this overly verbose little | |
// guy: | |
// |
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
# ~/.osx — http://mths.be/osx | |
############################################################################### | |
# General UI/UX # | |
############################################################################### | |
# Set computer name (as done via System Preferences → Sharing) | |
scutil --set ComputerName "MathBook Pro" | |
scutil --set HostName "MathBook Pro" | |
scutil --set LocalHostName "MathBook-Pro" |
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
# ============================================================ | |
# PluginName v0.0.0 | |
# http://URL | |
# ============================================================ | |
# Copyright 2012 The Beans Group | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# |
OlderNewer