Skip to content

Instantly share code, notes, and snippets.

Avatar

Glen Cheney Vestride

View GitHub Profile
@Vestride
Vestride / bundles-to-markdown.js
Last active Jul 29, 2020
webpack bundle text to markdown table
View bundles-to-markdown.js
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\((.+)\)/;
async function getFileLines() {
let contents;
@Vestride
Vestride / update-sass-global-variable.scss
Last active Dec 4, 2019
How to overwrite global variables in Sass.
View update-sass-global-variable.scss
// Use `!global` when assigning it.
$day: "Monday :(";
@mixin update-day() {
$day: "Friday!" !global;
};
.today {
@include update-day();
@Vestride
Vestride / encoding-video.md
Last active Sep 22, 2020
Encoding video for the web
View encoding-video.md

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
@Vestride
Vestride / speedruns.js
Last active Jul 8, 2020
Parses the Halo Waypoint MCC campaign page and calculates your total time as well as a per-mission breakdown of your timings.
View speedruns.js
(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' },
@Vestride
Vestride / jquery.paginate.js
Created Sep 25, 2012
Paginate a grid of items
View jquery.paginate.js
// 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
@Vestride
Vestride / Cleanup Layer Comps.jsx
Created Jul 5, 2012
Photoshop layer comp cleanup script
View Cleanup Layer Comps.jsx
/**
* 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
*/
You can’t perform that action at this time.