Skip to content

Instantly share code, notes, and snippets.

View stellasphere's full-sized avatar

Leo Ueno stellasphere

View GitHub Profile
@stellasphere
stellasphere / slotText.js
Created November 13, 2023 21:57
A rotating slot-like text animation.
async function rotateText(target, texts, options={}) {
// target: the container of the text
// texts: an array with the text you want it to rotate between
// options: see below
var defaultOptions = {
rotateTime: 3000,
transitionTime: 500,
startText: 0,
appearFirst: true,
debug: false
@stellasphere
stellasphere / convert-color-space.ipynb
Last active July 15, 2023 01:21
convert-color-space.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stellasphere
stellasphere / betterregexmatches.js
Last active August 19, 2022 02:25
Better regex matching with better way to access groups
function match(string,regex) {
var matches = []
var m;
// Based on example code from regex101.com
while ((m = regex.exec(string)) !== null) {
// This is necessary to avoid infinite loops with zero-width matches
if (m.index === regex.lastIndex) {
regex.lastIndex++;
}
@stellasphere
stellasphere / descriptions.json
Last active November 14, 2024 14:09
WMO weather interpretation code descriptions (& images)
{
"0":{
"day":{
"description":"Sunny",
"image":"http://openweathermap.org/img/wn/[email protected]"
},
"night":{
"description":"Clear",
"image":"http://openweathermap.org/img/wn/[email protected]"
}