Skip to content

Instantly share code, notes, and snippets.

Justin Hileman bobthecow

Block or report user

Report or block bobthecow

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
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
paulirish / what-forces-layout.md
Last active Dec 7, 2019
What forces layout/reflow. The comprehensive list.
View what-forces-layout.md

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.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@anvaka
anvaka / top-github.md
Last active Sep 12, 2019
Top GitHub users by total number of stars
View top-github.md

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
scottjehl / noncritcss.md
Last active Oct 26, 2019
Comparing two ways to load non-critical CSS
View noncritcss.md

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: https://github.com/filamentgroup/loadCSS/


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: https://gist.github.com/igrigorik/2935269#file-notes-md ).

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

@Rarst
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
<?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
jasoncrawford / model.js
Last active Sep 5, 2016
Simple relations for Backbone models. Not as full-featured as Backbone-relational (http://backbonerelational.org/) or Supermodel (http://pathable.github.io/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
rowanu / README.md
Last active Aug 22, 2019
Hotness Widget for the Dashing dashboard from Shopify
View README.md

Dashing Hotness Widget

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

See the blog post for more details.

About

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
ttscoff / Bullseye.bookmarklet
Last active Aug 12, 2019
A bookmarklet for grabbing just a piece of a web page and converting it to Markdown using heckyesmarkdown.com.
View Bullseye.bookmarklet
javascript:(function(){var p=document.createElement("p");p.innerHTML="<strong>Loading&hellip;</strong>";p.id="loadingp";p.style.padding="20px";p.style.background="#fff";p.style.left="20px";p.style.top=0;p.style.position="fixed";p.style.zIndex="9999999";p.style.opacity=".85";document.body.appendChild(p);document.body.appendChild(document.createElement("script")).src="https://cdn.rawgit.com/ttscoff/6109434/raw/Bullseye.js?x="+(Math.random());})();
@petehamilton
petehamilton / README.md
Last active May 15, 2019
Circle CI Build Status widget for Dashing (Multiple Builds)
View README.md

Description

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.

Usage

  • 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

Then:

View gist:5189122

This is for RESTful PATCH awesomeness:

var myModel = new Backbone.Model({
  title:   "Current title",
  content: "Content",
  bonus:   42
});
You can’t perform that action at this time.