Skip to content

Instantly share code, notes, and snippets.

@aroben
aroben / README.md
Last active August 29, 2015 13:55
Chromium Infinite Scrolling Demo

This demo comes from Chromium's source repository. See the original here.

The scrollable area represents 500 "virtual" items (kNumberOfItems) using 30 "physical" DOM elements (kPhysicalCount). As elements get scrolled out of view to the top, they get moved down to the bottom via -webkit-transform: translate3d(0, NNNpx, 0) and their contents get replaced with the appropriate "virtual" item. requestAnimationFrame() is used to ensure that updates only happen once per repaint of the window.

@aroben
aroben / deleters.js
Last active August 29, 2015 14:04
Find who has deleted more code than they've added; run on https://github.com/rails/rails/graphs/contributors or similar
$.makeArray($('.capped-card')).map(function(e) {
return [$(e).find('.aname').text(), parseInt($(e).find('.a').text().replace(/,/g, ''), 10), parseInt($(e).find('.d').text().replace(/,/g, ''), 10)];
}).filter(function(a) {
return a[2] > a[1];
}).map(function(a) {
return [a[0], a[2] - a[1], a[2] / a[1]];
}).sort(function(a, b) {
return b[1] - a[1];
}).map(function(a) {
return a[0] + " removed " + a[1] + " lines (" + a[2].toFixed(2) + "x as many lines as they added)";
@aroben
aroben / index.html
Last active August 29, 2015 14:04
Test which Unicode code points are rendered as emoji on your system
<!DOCTYPE html>
<html>
<head>
<style>
body {
font-family: monospace, "Segoe UI Emoji";
}
</style>
</head>
<body>
@aroben
aroben / hissuegram.rb
Last active August 29, 2015 14:06
Script to generate a histogram of GitHub issue age
#!/usr/bin/env ruby
# Usage: GITHUB_TOKEN=yourtoken hissuegram.rb owner/repo
require "octokit"
client = Octokit::Client.new(:access_token => ENV["GITHUB_TOKEN"], :auto_paginate => true)
issues = client.issues ARGV[0], :state => :open
dates = issues.map { |i| i["created_at"] }
@aroben
aroben / hubot-commands.sh
Created November 12, 2014 19:34
Find most common Hubot commands from Campfire
#!/bin/sh
set -e
curl -s -u $CAMPFIRE_TOKEN:X https://$CAMPFIRE_ACCOUNT.campfirenow.com/room/$CAMPFIRE_ROOM/transcript.json | jq -r '.messages | .[] | select(.body != null) | .body | select(startswith("/"))' | cut -d' ' -f1 | sort | uniq -c | sort -rn
@aroben
aroben / license.diff
Last active August 29, 2015 14:09
Patch to add a license to Genshi.tmbundle
Index: textmate/Genshi.tmbundle/COPYING
===================================================================
--- textmate/Genshi.tmbundle/COPYING (revision 0)
+++ textmate/Genshi.tmbundle/COPYING (working copy)
@@ -0,0 +1,28 @@
+Copyright (C) 2014 Edgewall Software
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
@aroben
aroben / flaky_in_page.txt
Created July 15, 2011 15:33 — forked from anonymous/flaky_in_page.txt
flaky test display mock
Possibly Flaky Tests
fast/text/midword-break-before-surrogate-pair.html
r12363 (30012) (results.html): pretty diff
r12359 (30010) (results.html): pretty diff
r12350 (30007) (results.html): pretty diff
Existing bugs related to this test:
* [Bug 25341] This test is horrible!
File new bug for this flaky test
@aroben
aroben / fixit.patch
Created June 12, 2012 17:02
Fix gitignore spaces parsing in libgit2
diff --git a/src/ignore.c b/src/ignore.c
index fc6194b..f2d08f5 100644
--- a/src/ignore.c
+++ b/src/ignore.c
@@ -28,6 +28,8 @@ static int parse_ignore_file(
GITERR_CHECK_ALLOC(match);
}
+ match->flags = GIT_ATTR_FNMATCH_ALLOWSPACE;
+
// Note: Some Emscripten settings will significantly limit the speed of the generated code.
// Note: Some Emscripten settings may limit the speed of the generated code.
// TODO: " u s e s t r i c t ";
try {
this['Module'] = Module;
} catch(e) {
this['Module'] = Module = {};
}
@aroben
aroben / unzip-output.txt
Created February 5, 2013 21:33
Error message when extracting IE7 VMWare VM from modern.ie
$ unzip IE7_Vista.vmwarevm.zip
Archive: IE7_Vista.vmwarevm.zip
warning [IE7_Vista.vmwarevm.zip]: 1384807849 extra bytes at beginning or within zipfile
(attempting to process anyway)
error [IE7_Vista.vmwarevm.zip]: start of central directory not found;
zipfile corrupt.
(please check that you have transferred or created the zipfile in the
appropriate BINARY mode and that you have compiled UnZip properly)