Skip to content

Instantly share code, notes, and snippets.


Justin Hileman bobthecow

View GitHub Profile
View system_ruby_version.markdown

What is the system Ruby?

What version of Ruby shipped by default on Mac OS X?

* Refers to the fully patched version (e.g. 10.5.8, not 10.5.0). Earlier versions may have shipped with different Ruby patchlevels but the RUBY_VERSION has never changed within major Mac OS X releases.
Mac OS X version* Mac OS X release date Default Ruby version
paulirish /
Last active Feb 24, 2021
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
anvaka /
Last active Feb 3, 2021
Top GitHub users by total number of stars

I was playing with GitHub Archive recently. Out of curiosity I ran this query:

SELECT COUNT(repository_owner) as totalStars, repository_owner
FROM [githubarchive:github.timeline] 
WHERE type = 'WatchEvent'
GROUP BY repository_owner
ORDER BY totalStars DESC
LIMIT 1000
scottjehl /
Last active Jul 15, 2020
Comparing two ways to load non-critical CSS

I wanted to figure out the fastest way to load non-critical CSS so that the impact on initial page drawing is minimal.

TL;DR: Here's the solution I ended up with:

For async JavaScript file requests, we have the async attribute to make this easy, but CSS file requests have no similar standard mechanism (at least, none that will still apply the CSS after loading - here are some async CSS loading conditions that do apply when CSS is inapplicable to media: ).

Seems there are a couple ways to load and apply a CSS file in a non-blocking manner:

Rarst / mustachepot.php
Last active Sep 29, 2016
MustachePOT extends MakePOT in WordPress tools to additionally scan for localized strings in Mustache templates.
View mustachepot.php
error_reporting( E_ALL ^ E_STRICT ); // le sigh
require __DIR__ . '/wordpress/tools/i18n/makepot.php';
* Additionally scans for localized strings in Mustache templates.
class MustachePOT extends MakePOT {
jasoncrawford / model.js
Last active Sep 5, 2016
Simple relations for Backbone models. Not as full-featured as Backbone-relational ( or Supermodel (, but pretty lightweight and concise. Disclaimer: I excerpted this from some other code I wrote and haven't tested it independently. Use at your own risk
View model.js
var relationEvents = ['add', 'change', 'remove', 'reset', 'sort', 'destroy', 'request', 'sync'];
var Model = exports.Model = Backbone.Model.extend({
hasMany: {
// Subclasses can override to set relations like this:
// key: function () { return new Collection([], options); },
hasOne: {
rowanu /
Last active Aug 22, 2019
Hotness Widget for the Dashing dashboard from Shopify

Dashing Hotness Widget

Are you dashing? Are you hot? Then you need the Dashing Hotness Widget!

See the blog post for more details.


This widget is similar to the basic Number widget, except that the entire widget changes colour based on the value displayed. It is designed to draw attention to

ttscoff / Bullseye.bookmarklet
Last active Feb 24, 2021
A bookmarklet for grabbing just a piece of a web page and converting it to Markdown using
View Bullseye.bookmarklet
javascript:(function(){var p=document.createElement("p");p.innerHTML="<strong>Loading&hellip;</strong>";"loadingp";"20px";"#fff";"20px";;"fixed";"9999999";".85";document.body.appendChild(p);document.body.appendChild(document.createElement("script")).src=""+(Math.random());})();
petehamilton /
Last active Mar 31, 2020
Circle CI Build Status widget for Dashing (Multiple Builds)


Dashing widget to show the status of builds from CircleCI. Also shows the avatar of the person who is running/breaking/passing the current build.


  • Get a Circle API Token from your Account Dashboard and set it in your environment as CIRCLE_CI_AUTH_TOKEN
  • Add the httparty to your Gemfile and run bundle install


View gist:5189122

This is for RESTful PATCH awesomeness:

var myModel = new Backbone.Model({
  title:   "Current title",
  content: "Content",
  bonus:   42