Dan Beam danbeam

View chromium.gyp_env
1 2 3
{
'GYP_DEFINES': 'chromeos=1 clang=1 component=shared_library'
}
View chromiumcodereview-loc.js
1
javascript:var t=0;Array.prototype.forEach.call(document.querySelectorAll('[name=patch] td:nth-of-type(7)'),function(e){t+=eval(e.textContent.replace(/[lines ,]/g,'').replace('-','+'));});alert(total);
View gist:5708457
1 2 3 4 5 6 7 8 9 10
// ==UserScript==
// @name Refresher and scroller
// @namespace refresh-and-scroll
// @description Refreshes page after 5s and scrolls to 1000px.
// @match https?://yourdomain.com/*
// @version 0.1
// ==/UserScript==
 
window.addEventListener('load', function() {
window.scrollTop = 1000 /* px from the top */;
View find_authors.sh
1 2 3 4 5 6 7 8 9 10
find_authors() {
local locations;
[ $# -eq 0 ] && locations='.' || locations="$@";
for loc in $locations; do
echo "finding top 3 authors for: $loc";
local dir;
[ -d "$loc" ] && dir="$loc" || dir="`dirname "$loc"`";
local vcs;
if [ -d "$dir/.svn" ]; then
find "$loc" -type f | grep -v '\/.svn' | \
View reload.user.js
1 2 3 4 5 6 7 8 9 10
// ==UserScript==
// @name Tree Reloader
// @namespace tree-reloader
// @description Reloads the tree
// @match http://build.chromium.org/*
// @match https://build.chromium.org/*
// @match http://chromegw.corp.google.com/*
// @match https://chromegw.corp.google.com/*
// @match http://chromium-build.appspot.com/*
// @match https://chromium-build.appspot.com/*
View gist:2649716
1 2 3 4 5 6 7 8 9 10
$ cat blah.cc
#include <iostream>
 
int main() {
int i = 0;
if (i || (i = 5))
std::cout << "yay!";
return 0;
}
$ g++ blah.cc
View gist:2494970
1 2 3 4 5 6 7 8 9 10
var n = 100000;
 
console.time('innerHTML');
var e = document.createElement('div');
e.innerHTML = Array(n+1).join('<span></span>');
console.log(document.body.appendChild(e).children.length + ' inserted!');
console.timeEnd('innerHTML');
 
console.time('DOM');
var d = document.createElement('div');
View master_regex.py
1
(?P<t_COMMENT>\/\*(?:[^*])*(?:\*)+(?:[^/](?:[^*])*(?:\*)+)*\/)|(?P<t_STRING>(?:(?:"(?:(?:(?:[^\n\r\f\\"])|(?:\\\n|\r\n|\r|\f)|(?:(?:(?:\\[0-9a-fA-F]{1,6}(?:(?:(?:\r\n)|(?:[ \t\r\n\f])))?)|(?:\\[^\r\n\f0-9a-fA-F])))))*")|(?:'(?:(?:(?:[^\n\r\f\\'])|(?:\\\n|\r\n|\r|\f)|(?:(?:(?:\\[0-9a-fA-F]{1,6}(?:(?:(?:\r\n)|(?:[ \t\r\n\f])))?)|(?:\\[^\r\n\f0-9a-fA-F])))))*')))|(?P<t_INVALID>(?:(?:"(?:(?:(?:[^\n\r\f\\"])|(?:\\\n|\r\n|\r|\f)|(?:(?:(?:\\[0-9a-fA-F]{1,6}(?:(?:(?:\r\n)|(?:[ \t\r\n\f])))?)|(?:\\[^\r\n\f0-9a-fA-F])))))*)|(?:'(?:(?:(?:[^\n\r\f\\'])|(?:\\\n|\r\n|\r|\f)|(?:(?:(?:\\[0-9a-fA-F]{1,6}(?:(?:(?:\r\n)|(?:[ \t\r\n\f])))?)|(?:\\[^\r\n\f0-9a-fA-F])))))*)))|(?P<t_EMS>(?:(?:(?:[0-9])*\.(?:[0-9])+)|(?:(?:[0-9])+))(?:(?:e)|(?:\\0{0,4}(?:(?:45)|(?:65))(?:(?:(?:\r\n)|(?:[ \t\r\n\f])))?))(?:(?:m)|(?:\\0{0,4}(?:(?:4d)|(?:6d))(?:(?:(?:\r\n)|(?:[ \t\r\n\f])))?)))|(?P<t_EXS>(?:(?:(?:[0-9])*\.(?:[0-9])+)|(?:(?:[0-9])+))(?:(?:e)|(?:\\0{0,4}(?:(?:45)|(?:65))(?:(?:(?:\r\n)|(?:[ \t\r\n\f])))?))(?:(?:x)|(?:\\0{0,4}(?:(?:58)|(?:7
View get-coffee.bash
1 2 3 4 5 6 7 8 9 10
#!/bin/bash
 
while true; do
echo -n ' ';
head -10 /dev/urandom | hexdump -C | head -3 | cut -d' ' -f2-18 | tr "\n" " " | \
sed -e 's/[0-9a-f][0-9a-f]/\x1b[34m&\x1b[0m/g' | \
sed -e 's/[a-c][0-3]/\x1b[41m&\x1b[0m/g' | \
sed -e 's/[d-f][4-6]/\x1b[42m&\x1b[0m/g' | \
sed -e 's/[0-3][0-3]/\x1b[9m&\x1b[0m/g' | \
sed -e 's/[4-6][4-6]/\x1b[7m&\x1b[0m/g' | \
View chromium-status-utc-to-local-time.js
1
javascript:(function(){var y=', '+new Date().getFullYear(),j={0:'Sun',1:'Mon',2:'Tue',3:'Wed',4:'Thu',5:'Fri',6:'Sat'},m={0:'Jan',1:'Feb',2:'Mar',3:'Apr',4:'May',5:'Jun',6:'Jul',7:'Aug',8:'Sep',9:'Oct',10:'Nov',11:'Dec'};[].forEach.call(document.querySelectorAll('table[border] td:nth-of-type(2)'),function(el,i){if(i==0){el.width=160;}else{var d,p=el.textContent.split(',');p.splice(1,0,y);d=new Date(p.join(''));el.textContent=j[d.getDay()]+' '+m[d.getMonth()]+' '+(d.getDate()<10?'0':'')+d.getDate()+', '+(d.getHours()>12?(d.getHours()-12==0?'12':d.getHours()-12):(d.getHours()==0?'12':d.getHours()))+':'+(d.getMinutes()<10?'0':'')+d.getMinutes()+' '+(d.getHours()>12?'p':'a')+'m';}});}());
Something went wrong with that request. Please try again.