Skip to content

Instantly share code, notes, and snippets.

I may be slow to respond.

Ryan Chandler ryangjchandler

I may be slow to respond.
View GitHub Profile
rosswintle / build.php
Last active April 6, 2023 21:50
A VERY simple PHP static HTML generator that does a single-level extend, and includes with variable passing and that's about it.
View build.php
* Input: files matching src/pages/*.html
* Output: public/*.html
* Pages can extend a template by calling:
* extend(string $relativeTemplatePath, array $variables)
* at the start and:
owenvoke / readDuration.php
Created May 5, 2021 10:17
A string macro for the duration to read text.
View readDuration.php
// From Marcel Pociot's tweet
// See:
Str::macro('readDuration', function (... $text) {
$totalWords = str_word_count(implode(' ', $text));
$minutesToRead = round($totalWords / 200);
return (int) max(1, $minutesToRead);
gullyn / flappy.html
Last active November 27, 2022 06:15
Flappy bird in 205 bytes (improved!)
View flappy.html
<body onload=z=c.getContext`2d`,setInterval(`c.width=W=150,Y<W&&P<Y&Y<P+E|9<p?z.fillText(S++${Y=`,9,9|z.fillRect(p`}*0,Y-=--M${Y+Y},P+E,9,W),P))):p=M=Y=S=6,p=p-6||(P=S%E,W)`,E=49) onclick=M=9><canvas id=c>
aishikaty /
Last active April 21, 2023 14:39
Tiny JavaScript UI

☀️ UI Libraries

  • redom (1.6k) - Tiny turboboosted JavaScript library for creating user interfaces
  • frzr (1.6k) - Turboboosted 2 KB view library for browser & node.js
  • killroy (1.9k) - A tiny ui library inspired by React
  • real-dom (0.7k) - A ~1K non-virtual DOM non-framework framework for simple apps
  • domchanger (1.8k) - Dombuilder that applies diffs only to the real dom
  • vomit (3.2k) - A high order function using virtual dom to build user interfaces
  • bel (3.5k) - A simple library for composable DOM elements using tagged template strings
  • yo-yo (5.4k) - A tiny library for building modular UI components using DOM diffing and ES6 tagged template literals (build on bel)
  • [choo](
itod /
Last active May 26, 2023 14:34
Every "split" mechanical keyboard currently being sold that I know of
GaspardP / sha256.js
Created June 4, 2015 15:21
SHA-256 with Javascript and Web Crypto
View sha256.js
// Computes the SHA-256 digest of a string with Web Crypto
// Source:
function sha256(str) {
// Get the string as arraybuffer.
var buffer = new TextEncoder("utf-8").encode(str)
return crypto.subtle.digest("SHA-256", buffer).then(function(hash) {
return hex(hash)