Skip to content

Instantly share code, notes, and snippets.

View RichardIvan's full-sized avatar

Richard Ivan RichardIvan

View GitHub Profile
@RichardIvan
RichardIvan / machine.js
Last active March 22, 2023 15:57
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
@RichardIvan
RichardIvan / machine.js
Last active March 22, 2023 15:58
Generated by XState Viz: https://xstate.js.org/viz
const isFromEditMachine = (context, event) => {
return event.origin === 'editMachine';
};
const isFromRefundMachine = (context, event) => {
return event.origin === 'refundMachine';
};
const fetchMachine = Machine({
id: 'booking',
/* count number of pushes between Jan 1 and Jan 5 using TABLE_DATE_RANGE */
SELECT COUNT(*) FROM (
TABLE_DATE_RANGE([githubarchive:day.events_],
TIMESTAMP('2015-01-01'),
TIMESTAMP('2015-05-01')
))
WHERE type = 'PushEvent'
/* count number of watches between Jan~Oct 2014 using TABLE_QUERY */
SELECT COUNT(*) FROM (
@RichardIvan
RichardIvan / app.yaml
Created April 23, 2016 20:03 — forked from darktable/app.yaml
GAE: App.yaml designed for serving a static site on Google App Engine (Python). Copy your static html and files into a folder called "static" next to app.yaml. Contains a bunch of mimetype declarations from html5boilerplate's .htaccess. May not be neces
application: you-app-name-here
version: 1
runtime: python
api_version: 1
default_expiration: "30d"
handlers:
- url: /(.*\.(appcache|manifest))
mime_type: text/cache-manifest
@RichardIvan
RichardIvan / app.yaml
Created April 23, 2016 20:02 — forked from addyosmani/app.yaml
Google App Engine (Python) - app.yaml for hosting a static site
application: your-app-name
version: 1
runtime: python27
api_version: 1
threadsafe: true
default_expiration: "30d"
handlers:
# web files