Skip to content

Instantly share code, notes, and snippets.

View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
View machine.js
const current = Machine({
id: 'video-player',
initial: 'playing_controlsHidden',
context: {
retries: 0
},
states: {
playing_controlsHidden: {
on: {
PRESS_STOP: 'playing_controlsVisible'
View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
View machine.js
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
View SketchSystems.spec
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
@saoirse-zee
saoirse-zee / demo-request-animation-frame.html
Last active Jul 24, 2019
Demo request animation frame
View demo-request-animation-frame.html
<html>
<body>
<div id="smiley" style="position: absolute;">😌</div>
<script>
const {requestAnimationFrame} = window
let i = 0
const smiley = document.querySelector('#smiley')
View Makefile for Elm
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)
View express_crud.js
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 = ''
View document dot ready
$(function(){
// Put all yor code here. This will run only after the DOM is ready.
})
View go.sh
#!/bin/bash
echo 'Are you sure you want to do this? (y)'
read RESPONSE
if [ "$RESPONSE" == "y" ]; then
cd ~/dev
echo 'Name your project (no-spaces-please)':
read NAME