Skip to content

Instantly share code, notes, and snippets.

@sea-witch
sea-witch / make.gif.sh
Created March 7, 2022 14:46
Make a gif from a list of images. Depends on Imagemagick
#!/bin/sh
echo $DATE
SOURCE="./snaps/*a.png"
DEST="out-"
DEST+=`date '+%Y-%m-%d_%H%M%S'`
DEST+=".gif"
echo $DEST
convert -delay 70 \
@sea-witch
sea-witch / machine.js
Last active August 10, 2021 21:03
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@sea-witch
sea-witch / machine.js
Created November 16, 2020 21:37
Generated by XState Viz: https://xstate.js.org/viz
const current = Machine({
id: 'video-player',
initial: 'playing_controlsHidden',
context: {
retries: 0
},
states: {
playing_controlsHidden: {
on: {
PRESS_STOP: 'playing_controlsVisible'
@sea-witch
sea-witch / machine.js
Created November 16, 2020 20:55
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@sea-witch
sea-witch / machine.js
Created August 24, 2020 13:04
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@sea-witch
sea-witch / SketchSystems.spec
Created November 8, 2019 15:20
Refund form
Refund form
Selecting refund method
select cash -> No reminder
select credit -> Credit card
select donation -> Donation
Cash
select reminder -> Reminder
Reminder
No reminder
Credit card
@sea-witch
sea-witch / demo-request-animation-frame.html
Last active July 24, 2019 03:50
Demo request animation frame
<html>
<body>
<div id="smiley" style="position: absolute;">😌</div>
<script>
const {requestAnimationFrame} = window
let i = 0
const smiley = document.querySelector('#smiley')
HTML_SRC=src/index.html
ELM_SRC=src/Main.elm
DIST=public
RIGHT_NOW=$(shell date "+%B %d, %Y at %H:%M:%S")
TIMESTAMP="<!-- Created at $(RIGHT_NOW) -->\n"
all: public index.html main.js
public:
@ mkdir $(DIST)
var express = require('express');
var router = express.Router();
router.get('/', function(req, res) {
res.send('READ all items');
});
router.post('/new', function(req, res) {
var data = req.body
var response = ''
$(function(){
// Put all yor code here. This will run only after the DOM is ready.
})