Skip to content

Instantly share code, notes, and snippets.

@larrybotha
larrybotha / machine.js
Last active October 22, 2019 14:00
Generated by XState Viz: https://xstate.js.org/viz
// Luna Med auth machine
const fetchMachine = Machine({
id: 'auth',
initial: 'unknown',
states: {
unknown: {
entry: 'storeRequestUrl',
@larrybotha
larrybotha / machine.js
Last active October 4, 2019 22:51
Generated by XState Viz: https://xstate.js.org/viz
const bullishMachineConfig = {
initial: 'findingStock',
on: {
MARKET_TRENDING_DOWN: 'bearish',
MARKET_TRENDING_SIDEWAYS: 'evaluatingGeneralMarket',
},
states: {
findingStock: {
@larrybotha
larrybotha / machine.js
Last active September 30, 2019 03:12
Generated by XState Viz: https://xstate.js.org/viz
const tradingStrategyMachine = Machine({
id: 'three-step-trading-process',
initial: 'backtesting',
context: {
timesRefactored: 0,
},
states: {
@larrybotha
larrybotha / machine.js
Last active September 20, 2019 21:32
Generated by XState Viz: https://xstate.js.org/viz
const xeroOrgMachine = Machine({
id: 'xeroOrg',
initial: 'noOrg',
states: {
noOrg: {
invoke: {
src: "requestAuthUrl",
onDone: "exchangingToken",
@larrybotha
larrybotha / machine.js
Last active September 20, 2019 21:14
LunaMed UI User Machine: https://xstate.js.org/viz
const userMachine = Machine({
id: "user",
initial: "noUser",
states: {
noUser: {
invoke: {
src: "getUser",
onDone: "userFound",
@larrybotha
larrybotha / _gradient.scss
Created April 19, 2013 11:43
A Sass mixin to allow output of multiple backgrounds with vendor prefixes.
// This mixin allows for vendor prefixing of gradients, and allows for multiple
// backgrounds. It also allows you to define with which property you would like
// to apply your gradients.
// i.e. background / background-image / etc.
//
// It supports both the old and new syntaxes - but be warned - using the official
// 'to [direction]' syntax will result in browsers supporting only the old webkit
// syntax not rendering a gradient at all.
//
// https://developer.mozilla.org/en-US/docs/CSS/Tutorials/Using_CSS_gradients
@larrybotha
larrybotha / A.markdown
Last active April 14, 2018 14:15
Add your public SSH key to your server in one command

Add Your Public SSH Key To Your Server In One Command

You will need to create .ssh/authorized_keys if it is not yet on your server.

cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> .ssh/authorized_keys'

Generating Your Own Public Key

@larrybotha
larrybotha / _px-and-rem.scss
Last active April 9, 2018 16:50
Sass mixin - rems with px fallback
// This mixin outputs a property with rem units and a px fallback.
// Values passed without units are used as multipliers for the final
// rem and px values, all other units are output without modification.
// $base-font-size represents the root value of the document font-size
// in pixels.
//
// i.e. html { font-size: 100%;} // -> 16px
// Usage:
// @include px-and-rem([property], [multiplier | explicit value] [, ...]);
@larrybotha
larrybotha / A.markdown
Last active April 7, 2017 22:10
Two.js Renderer for PhysicsJS

Two.js Renderer for PhysicsJS

A starting point for a Two.js renderer for PhysicsJS.