Skip to content

Instantly share code, notes, and snippets.

🍐
Working on a relaunch.

Charlie Park charliepark

🍐
Working on a relaunch.
Block or report user

Report or block charliepark

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 php_write_to_file_perf_test.php
<?PHP
shell_exec("touch messages1.txt");
shell_exec("touch messages2.txt");
$time_1 = microtime(true);
for ($i=1; $i<1000; $i++) {
file_put_contents('messages1.txt', "This is the sample text\n", FILE_APPEND);
}
$time_delta_1 = microtime(true) - $time_1;
@charliepark
charliepark / blipnote.html
Created Jul 28, 2015
The source code to blipnote.com
View blipnote.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="cache-control" content="public">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=1">
<title>Blipnote</title>
<style type="text/css">html,body,div,span,h1,h2,p,a,form,aside,footer,header,nav{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}aside,footer,header,nav,section{display:block}body{line-height:1}a{color:rgba(255,255,255,.5);cursor:pointer;text-decoration:none}nav a{font-size:12px;letter-spacing:.2em;margin:20px;padding:10px;text-align:center;text-transform:uppercase}a[href*="mailto"]{background:rgba(0,0,0,.2);color:#fff;padding:0 4px}aside{background:#00779d;display:none;overflow:auto;position:absolute;top:0;left:0;bottom:0;right:0;z-index:9}body{box-sizing:border-box;font-family:"gill sans","gill sans mt",sans-serif;letter-spacing:1px;margin:10% auto 0;position:relative;text-align:center;width:350px}body{display:flex;flex-direction:column}header{height:55px
@charliepark
charliepark / gutenberg.css
Created Jul 22, 2015
CSS to insert into the style block of a Project Gutenberg page to make it more legible
View gutenberg.css
*{font-family: "Avenir Next", "avenir next", avenir next, avenir !important;line-height:1.65}
h3{color: #444;margin: 1rem 0;}
hr{border:0;background: none;border-bottom: 1px solid #eee;}
h3 + hr{margin-bottom: 2rem}
p + hr{margin-top: 4rem;}
p{margin: 0 auto 1.65em;max-width: 36em;text-align: left}
.poem .stanza{background-color: #F6F6F6;border-radius: 10px;box-sizing: border-box;margin: 1em auto;max-width: 36rem;padding: 1rem 1.5rem;}
View BalancedMeasures2.js
var BalancedMeasures = {
minimumScreenSizeToRunOn: 992,
classNameToBalance: "graf--pullquote",
run: function(classToRunOn){
if(this.onSmallerScreen()){return;}
var elements = this.getElementsToBalance(classToRunOn);
for(var i = 0; i < elements.length; i++){
this.balance(elements[i]);
}
View BalancedMeasures.js
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 Aug 29, 2015
Recordings when John / TMG introduced now-classic songs
View mountain_goats_new_songs.md
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/
View Doing.js
{
"When you open your computer" : [
"turn off deeplink test",
"turn off wtf / recipes test"
]
}
View 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);
}
}
You can’t perform that action at this time.