Skip to content

Instantly share code, notes, and snippets.

View charliepark's full-sized avatar
🚀

Charlie Park charliepark

🚀
View GitHub Profile
var BalancedMeasures = {
minimumScreenSizeToRunOn: 992,
classNameToMeasure: "graf--pullquote",
breakCode: "<br class='bmjs'>",
charactersToTriggerOrphanScreen: /[,\.\?\!]/,
run: function(classToRunOn){
if(this.onSmallerScreen()){return;}
var elements = this.getElementsToMeasure(classToRunOn);
Log.toConsole(elements.length);
for(var i = 0; i < elements.length; i++){
@charliepark
charliepark / mountain_goats_new_songs.md
Last active August 29, 2015 14:20
Recordings when John / TMG introduced now-classic songs
Song Title Date Venue City Link Show Page
Attention All Pickpockets 2007-06-17 Farm Sanctuary Watkins Glen, NY https://archive.org/details/tmg2007-06-17.flac
Cry for Judas 2012-10-13 Music Hall of Williamsburg Brooklyn, NY https://archive.org/download/MountainGoats2012-10-13.nyctaper/MountainGoats2012-10-13_nyctaper_t23.mp3 https://archive.org/details/MountainGoats2012-10-13.nyctaper
Dance Music 2004-05-26 Bottom of the Hill San Francisco, CA https://archive.org/details/tmg2004-05-26.flacf
Dilaudid 2004-10-04 The Magic Stick Detroit, MI https://archive.org/download/tmg2004-10-04.aud.320mp3/tmg2004-10-04t06.mp3 https://archive.org/details/tmg2004-10-04.aud.320mp3
Going to Georgia 1995-01-15 The Chameleon San Francisco, CA https://archive.org/download/tmg1995-01-15.aud.192mp3/tmg1995-01-15t11.mp3
Going to Maine 2004-10-11 The Black Cat Washington, DC https://archive.org/download/tmg2004-10-11.aud.128mp3/tmg2004-10-11t09.mp3 https://archive.org/details/
{
"When you open your computer" : [
"turn off deeplink test",
"turn off wtf / recipes test"
]
}
@charliepark
charliepark / performantRetina.js
Created February 24, 2015 13:45
performantRetina.js
var performantRetina = {
run : function(){
if(!window.devicePixelRatio || window.devicePixelRatio === 1){return;}
var images = document.getElementsByTagName('img');
for(var i = 0; i < images.length; i++){
var retinaSrc = images[i].getAttribute('data-retina-src');
if(!retinaSrc){continue;}
images[i].setAttribute('src', retinaSrc);
}
}
nav,
main,
section,
article,
aside,
header,
footer,
div,
details,
summary,
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
div{background:#eee;margin:10px;width:350px;border:20px solid #ccc;padding:10px}
p{font-family:courier;margin:0;padding:0;}
</style>
</head>
<body>
<div style="height:180px;"><p class="js-fit">This is some text to resize.</p></div>
@charliepark
charliepark / screenshot.js
Created June 5, 2014 00:29
A demo Phantom.js script
var width = 320;
var height = 480;
var webpage = require('webpage');
page = webpage.create();
page.viewportSize = {width: width, height: height};
page.open('https://ifttt.com', function(status) {
console.log(status);
page.evaluate(function(w, h) {
document.body.style.width = w + "px";

When GZIPped, is this …

h1 {
  font-size: 3em;
  font-weight: bold;
}

h2 {
 font-size: 2em;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
[
[
"Who taught you to do this stuff?",
"You, alright? I learned it by watching you!"
],
[
"Who in the world am I?",
"Ah, that's the great puzzle."
],