Skip to content

Instantly share code, notes, and snippets.

@Javarome
Javarome / machine.js
Created January 8, 2020 10:19
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@Javarome
Javarome / machine.js
Last active December 22, 2019 18:57
Generated by XState Viz: https://xstate.js.org/viz
const knMachine = Machine({
id: 'knowledge',
initial: 'created',
states: {
/**
* created or modified
*/
created: {
after: {
500: 'saved',
@Javarome
Javarome / index.html
Created September 3, 2018 10:02
Touch date input with placeholder
<body ng-app="dateApp">
<p>Touch-enabled devices (and Chrome) support <code>&lt;input type="date"&gt;</code> <a target="_blank" href="https://stackoverflow.com/questions/20321202/not-showing-placeholder-for-input-type-date-field/30442790#30442790">but the relevant fields UI do not allow placeholders</a>.</p>
<p>Here is a date input with a placeholder:</p>
<!--p>
Text : <date-input id="textDate" placeholder="Enter a date" data-mode="text"></date-input>
</p-->
<p>
Native as text : <date-input id="mobileDate" placeholder="Enter a date"></date-input>
</p>
<!--p>
@Javarome
Javarome / index.html
Created September 3, 2018 09:57
Responsive table
<p>Change the viewport's width to alternate between tabs and table display:</p>
<input id="col1" type="radio" name="column" checked>
<input id="col2" type="radio" name="column">
<table>
<thead>
<tr>
<th></th>
<th><label for="col1" tabindex="1">Free</label></th>
<th><label for="col2" tabindex="2">Premium version</label></th>
</tr>