Skip to content

Instantly share code, notes, and snippets.

View lroot's full-sized avatar

Larry lroot

View GitHub Profile
@lroot
lroot / convert-images.sh
Last active August 29, 2024 17:15
Convert images on the command line with sharp-cli
npx sharp-cli -i './image_src/*.png' -o './image_out/{name}.jpg' -f jpeg -q 92
@lroot
lroot / md5.js
Created September 11, 2019 16:44 — forked from MichaelPote/md5.js
invalid reference fix and fixed add32 not being overwritten properly.
/*
* http://www.myersdaily.org/joseph/javascript/md5-text.html
*/
(function (global) {
var md5cycle = function (x, k) {
var a = x[0],
b = x[1],
c = x[2],
d = x[3];
@lroot
lroot / Stylefile.yml
Created August 1, 2018 05:49
Customizations for giftcards-stage.townandcountrymarkets.com via StyleURL.
---
version: 1.0
domains:
- giftcards-stage.townandcountrymarkets.com
url_patterns:
- giftcards-stage.townandcountrymarkets.com/*
timestamp: '2018-08-01T05:49:24Z'
id: UGZi
redirect_url: https://giftcards-stage.townandcountrymarkets.com/
shared_via: StyleURL - (https://styleurl.app) import and export CSS changes from Chrome
<?php
/**
* Join a string with a natural language conjunction at the end.
*/
function natural_language_join(array $list, $conjunction = 'and') {
$last = array_pop($list);
if ($list) {
return implode(', ', $list) . ' ' . $conjunction . ' ' . $last;
}
return $last;
@lroot
lroot / 0_reuse_code.js
Created March 8, 2016 17:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@lroot
lroot / stripe-charge.php
Created September 30, 2015 01:07
Stripe Charge Response Data (PHP)
<?php
$charge = \Stripe\Charge::create(array(/* ... */));
echo $charge->jsonSerialize();
/* OUTPUT
array (
'id' => 'ch_16qYsuJSpQ6jmEwLd1CdGaLe',
'object' => 'charge',
'created' => 1343574552,
'livemode' => false,
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>HTML5 boilerplate</title>
<link rel="stylesheet" href="css/style.css">
<script src="js/main.js"></script>
</head>
<body>
<h1>HTML5 boilerplate</h1>
@lroot
lroot / gif-shim.html
Created August 22, 2013 16:39
single pixel gif data uri
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" >