Skip to content

Instantly share code, notes, and snippets.

View okor's full-sized avatar
🏎️

Jason Ormand okor

🏎️
  • Vox Media
  • Denver, CO
View GitHub Profile
~/Projects/voxmedia/thumbor $ make test
running build_ext
copying build/lib.macosx-10.10-x86_64-2.7/thumbor/ext/filters/_alpha.so -> thumbor/ext/filters
copying build/lib.macosx-10.10-x86_64-2.7/thumbor/ext/filters/_bounding_box.so -> thumbor/ext/filters
copying build/lib.macosx-10.10-x86_64-2.7/thumbor/ext/filters/_brightness.so -> thumbor/ext/filters
copying build/lib.macosx-10.10-x86_64-2.7/thumbor/ext/filters/_colorize.so -> thumbor/ext/filters
copying build/lib.macosx-10.10-x86_64-2.7/thumbor/ext/filters/_composite.so -> thumbor/ext/filters
copying build/lib.macosx-10.10-x86_64-2.7/thumbor/ext/filters/_contrast.so -> thumbor/ext/filters
copying build/lib.macosx-10.10-x86_64-2.7/thumbor/ext/filters/_convolution.so -> thumbor/ext/filters
copying build/lib.macosx-10.10-x86_64-2.7/thumbor/ext/filters/_curve.so -> thumbor/ext/filters
@okor
okor / gist:e519382c52d4921e770e
Created April 16, 2015 18:57
WPT locations response
{
"response":{
"statusCode":200,
"statusText":"Ok",
"data":{
"location":[
{
"id":"us-east-1:Chrome",
"Label":"US East (N. Virginia)",
"location":"us-east-1",
@okor
okor / mod-monokai.png
Last active August 29, 2015 14:15
My slightly modified SublimeText 3 theme - 99% Monokai
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!-- Generated by: TmTheme-Editor -->
<!-- ============================================ -->
<!-- app: http://tmtheme-editor.herokuapp.com -->
<!-- code: https://github.com/aziz/tmTheme-Editor -->
<plist version="1.0">
<dict>
<key>gutterSettings</key>
<dict>
@okor
okor / slack_theme.css
Last active August 29, 2015 14:15
Slack theme
.channels_list_holder h2 {
font-size: 14px;
}
.list_more {
font-size: 14px;
}
.channels_list_holder ul li {
font-size: 18px;
@okor
okor / gist:79c38cfb03b153bd4eb2
Created February 9, 2015 04:35
Install Thumbor on Ubuntu 14.04
# sudo su and run the following
sudo apt-get update && \
sudo apt-get -y upgrade && \
# install all dependencies
sudo apt-get -y install \
build-essential \
checkinstall \
gcc \
@okor
okor / estimateNumRequests
Created January 31, 2015 05:45
An attempt to calculate the number of blocking request on a webpage, uncertain of it's accuracy
function estimateNumRequests() {
var netCount = 1; // 1 for the webpage itself
var elements = null;
// all css
elements = document.getElementsByTagName('link');
for (var i = 0; i < elements.length; i++) {
var isStyleSheet = elementAttributeMatches(elements[i], 'rel', 'style') || elementIsTypeOf(elements[i], 'css');
if (elements[i].getAttribute('href') && urlIsRemote(elements[i].getAttribute('href')) && isStyleSheet) {
@okor
okor / gist:8f9ec375ed19155b3712
Created January 20, 2015 22:40
Install ruby 2.1.1 on Ubuntu 14.04 64 bit with rbenv
RUBY_CONFIGURE_OPTS=--with-readline-dir="/usr/lib/x86_64-linux-gnu/libreadline.so" rbenv install 2.1.1
@okor
okor / example_results.png
Last active August 29, 2015 14:09
Grab all png's from a page an displays them in an overlay. Intended use if for discovery of PNG assets that should probably be JPG's to save on weight.
example_results.png
@okor
okor / gist:505d7ec3fd4489b2cc8d
Last active August 29, 2015 14:09
Gathering network stats for loaded resources via Chrome console

#The kitchen sink (er thing)

console.table(performance.getEntries())

#Generate a unique array of all domains which load network assets on a webpage ** Requires Underscore or LoDash **

_.uniq(_.map(performance.getEntries(), function(e){ return { duration: e.duration, domain: e.name.split(/http\:\/\/|https\:\/\//)[1].split('/')[0] } }))

@okor
okor / image-stats.js
Last active August 29, 2015 14:09
Responsive design image efficiency stats - will display a table of results for all images and background images (ignores 0/1px tracking pixels)
// Requires jQuery and Underscore or LoDash
$ = jQuery;
function stripURLWrap(cssBackground){
return cssBackground.replace(/^url/g,'').replace(/\(|\)/g, '')
}
function getPercentage(number) {
return Math.floor((Math.round( number * 10 ) / 10) * 100) + '%';