Skip to content

Instantly share code, notes, and snippets.

View MarceloAlves's full-sized avatar
🔥
Breaking things

Marcelo Alves MarceloAlves

🔥
Breaking things
View GitHub Profile
@MarceloAlves
MarceloAlves / machine.js
Created August 17, 2021 15:40
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
interface Props {
text: string
}
export default function FitText({ text }: Props) {
return (
<div style={{ paddingLeft: 10 }}>
<svg
viewBox={`0 0 ${text.length * 16.5} 30`}
preserveAspectRatio='xMidYMin meet'
const MOISTURE_LEVEL = {
WET: 1,
DRY: 0,
}
const soilMachine = Machine(
{
id: 'soil',
initial: 'startup',
@MarceloAlves
MarceloAlves / machine.js
Last active May 21, 2020 05:09
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@MarceloAlves
MarceloAlves / machine.js
Last active May 20, 2020 02:52
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@MarceloAlves
MarceloAlves / machine.js
Last active May 12, 2020 02:39
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@MarceloAlves
MarceloAlves / machine.js
Last active May 1, 2020 07:01
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@MarceloAlves
MarceloAlves / machine.js
Last active April 30, 2020 06:01
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
'use strict';
const remove_suffix = '.example.com'; // TODO: Update domain name
const origin_hostname = 'example-bucket'; // TODO: Update bucket name
module.exports.cloudfront = (event, context, callback) => {
const request = event.Records[0].cf.request;
const headers = request.headers;
const host_header = headers.host[0].value;
import { createSlice as createSliceToolkit } from '@reduxjs/toolkit'
export interface StateSlice<T = any> {
data: T
isFetching: boolean
receivedAt: number | null
error: boolean
errorMessage: string | null
errorCode: number | null
}