Skip to content

Instantly share code, notes, and snippets.

View glen-cheney's full-sized avatar

Glen Cheney glen-cheney

View GitHub Profile
@glen-cheney
glen-cheney / Cleanup Layer Comps.jsx
Created July 5, 2012 02:02
Photoshop layer comp cleanup script
/**
* Photoshop layer comp cleanup script
*
* This script will run through all the layer comps, find layers that are hidden in every comp
* as well as any groups that are empty and delete them. Save before doing this just in case ;)
*
* @author Glen Cheney (http://glencheney)
* @version 1.1
* @date 7.10.12
*/
@glen-cheney
glen-cheney / jquery.paginate.js
Created September 25, 2012 06:53
Paginate a grid of items
// IMPORTANT!
// If you're already using Modernizr, delete it from this file. If you don't know what Modernizr is, leave it :)
/* Modernizr 2.5.3 (Custom Build) | MIT & BSD
* Build: http://www.modernizr.com/download/#-csstransforms-csstransforms3d-csstransitions-cssclasses-prefixed-teststyles-testprop-testallprops-prefixes-domprefixes
*/
;window.Modernizr=function(a,b,c){function z(a){j.cssText=a}function A(a,b){return z(m.join(a+";")+(b||""))}function B(a,b){return typeof a===b}function C(a,b){return!!~(""+a).indexOf(b)}function D(a,b){for(var d in a)if(j[a[d]]!==c)return b=="pfx"?a[d]:!0;return!1}function E(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:B(f,"function")?f.bind(d||b):f}return!1}function F(a,b,c){var d=a.charAt(0).toUpperCase()+a.substr(1),e=(a+" "+o.join(d+" ")+d).split(" ");return B(b,"string")||B(b,"undefined")?D(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),E(e,b,c))}var d="2.5.3",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m
@glen-cheney
glen-cheney / speedruns.js
Last active December 29, 2020 08:10
Parses the Halo Waypoint MCC campaign page and calculates your total time as well as a per-mission breakdown of your timings.
(function() {
/**
* Par times for each mission.
* <mission-id, minutes>
*/
var parTimes = {
// Halo 1
0: { par: 15, name: 'The Pillar of Autumn' },
1: { par: 20, name: 'Halo' },
@glen-cheney
glen-cheney / encoding-video.md
Last active November 24, 2024 10:09
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@glen-cheney
glen-cheney / update-sass-global-variable.scss
Last active August 6, 2023 10:05
How to overwrite global variables in Sass.
// Use `!global` when assigning it.
$day: "Monday :(";
@mixin update-day() {
$day: "Friday!" !global;
};
.today {
@include update-day();
@glen-cheney
glen-cheney / bundles-to-markdown.js
Created April 29, 2021 08:14
Convert 2 bundle analyzer outputs to a markdown table
#!/usr/bin/env node
const fs = require("fs").promises;
const path = require("path");
const filename = path.resolve(process.argv[2]);
// Match like "name-bundle.c660430462be77d62c18.js (2.02 MB)"
const regex = /(.+)\s\((.+)\)/;
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions