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
Array.prototype.forEach.call(document.querySelectorAll('a'), function(link) { | |
link.addEventListener('click', function(e) { | |
e.preventDefault(); | |
}) | |
}) |
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
errors found in common.js: | |
Trailing whitespace. (line: 6, character: 56) | |
> return bonzo(qwery(selector, context)); | |
Missing semicolon. (line: 10, character: 6) | |
> } | |
'define' is not defined. (line: 1, character: 1) | |
> define(["vendor/EventEmitter-3.1.5", "bonzo", "qwery"], function(placeholder, bonzo, qwery) { |
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
require 'digest/md5' | |
digest = Digest::MD5.hexdigest(File.read('path/to/png')) | |
puts "foo.#{digest}.png" |
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
Node with uglification | |
real 0m3.154s | |
user 0m3.036s | |
sys 0m0.097s | |
Node sans uglification | |
real 0m0.750s | |
user 0m0.628s |
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
# A script to extract data from tsung-fullstats.log files | |
def parse(log, key) | |
File.read(log).split('{').map { |entry| | |
next unless (entry =~ /#{key}/) | |
entry.scan(/\[.+\]/m).map { |group| | |
group.split(',').map { |timestamp| | |
timestamp.scan(/[\d\.]/).join('') | |
} |
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
/* ***** BEGIN LICENSE BLOCK ***** | |
* Version: MPL 1.1/GPL 2.0/LGPL 2.1 | |
* | |
* The contents of this file are subject to the Mozilla Public License Version | |
* 1.1 (the "License"); you may not use this file except in compliance with | |
* the License. You may obtain a copy of the License at | |
* http://www.mozilla.org/MPL/ | |
* | |
* Software distributed under the License is distributed on an "AS IS" basis, | |
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
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
1 Error: Load timeout for modules: http://s.ophan.co.uk/js/t6.min.js | |
http://requirejs.org/docs/errors.html#timeout,undefined,0 beta.guardian.co.uk,Mozilla5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS | |
1 Error: Load timeout for modules: http://s.ophan.co.uk/js/t6.min.js | |
http://requirejs.org/docs/errors.html#timeout,http://assets.guim.co.uk/javascripts/vendor/require-.af150a10d7618ab7e5dbb3fe1a26586c.js,7 beta.guardian.co.uk,Mozilla5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko20100101 | |
1 Error: Load timeout for modules: http://s.ophan.co.uk/js/t6.min.js | |
http://requirejs.org/docs/errors.html#timeout,http://assets.guim.co.uk/javascripts/vendor/require-.af150a10d7618ab7e5dbb3fe1a26586c.js,7 beta.guardian.co.uk,Mozilla5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko20100101 Firefox16.0, .63, | |
1 Error: Load timeout for modules: http://s.ophan.co.uk/js/t6.min.js | |
http://requirejs.org/docs/errors.html#timeout,http://assets.guim.co.uk/javascripts/vendor/require-.af150a10d7618ab7e5dbb3fe1a26586c.js,7 beta.gua |
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
~800 samples. | |
51 HTTP/1.1,200, 35, http://beta.guardian.co.uk/,Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/.94 Safari/537.4, .145, .100, .70, .125, 0.000, -, cache_status | |
51 HTTP/1.1,200, 35, http://beta.guardian.co.uk/world/2012/oct/22/final-debate-obama-romney-live,Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; NOKIA; Lumia 800), .69, .70, .70, .6, 0.000, -, cache_status | |
52 HTTP/1.1,200, 35, http://beta.guardian.co.uk/,Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/.94 Safari/537.4, .145, .100, .70, .125, 0.000, -, cache_status | |
52 HTTP/1.1,200, 35, http://beta.guardian.co.uk/media/2012/oct/22/bbc-newsnight-jimmy-savile-scandal,Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/.94 Safari/537.4, .24, .15, .70, .37, 0.000, -, cache_status | |
52 HTTP/1.1,200, 35, http://beta.guardian.co.uk/world,Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/.94 Safari/537. |
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
alias jsonval="ruby -e \"require 'rubygems'; require 'json'; JSON.parse(STDIN.read)\"" |
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
function isNumeric(str){ | |
return !isNaN(str); | |
} | |
function isBoolean(str){ | |
return (str === "true" || str === "false"); | |
} | |
// 1. +val casts any number (int, float) from a string | |
// 2. String(val) === "true" converts a string to bool |