Skip to content

Instantly share code, notes, and snippets.

@sea-witch
sea-witch / 0_reuse_code.js
Created November 5, 2015 15:09
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
@sea-witch
sea-witch / $.get-with-promises
Last active November 12, 2015 21:50
jQuery GET with promises
$.get(URI)
.done(function(data) {
console.log(data)
})
.fail(function() {
console.log('Failure!')
})
.always(function() {
console.log('They do it all the time. Yeah, yeah.')
})
This README outlines the details of collaborating on this Ember application.
A short introduction of this app could easily go here.
## Prerequisites
You will need the following things properly installed on your computer.
* [Git](http://git-scm.com/)
* [Node.js](http://nodejs.org/) (with NPM) and [Bower](http://bower.io/)
#!/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
$(function(){
// Put all yor code here. This will run only after the DOM is ready.
})
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 = ''
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)
@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')
@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 / 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