๐
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Available variables: | |
| // - Machine | |
| // - interpret | |
| // - assign | |
| // - send | |
| // - sendParent | |
| // - spawn | |
| // - raise | |
| // - actions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Set your secret key: remember to change this to your live secret key in production | |
| // See your keys here: https://dashboard.stripe.com/account/apikeys | |
| var stripe = require("stripe")(process.env.STRIPE_KEY_SECRET); | |
| exports.handler = (event, context, callback) => { | |
| //console.log('Received event:', JSON.stringify(event, null, 2)); | |
| const done = (err, res) => | |
| callback(null, { | |
| statusCode: err ? "400" : "200", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import styled from "@emotion/styled"; | |
| const DragContainer = styled.div` | |
| height: 460px; | |
| max-height: 80vh; | |
| width: 100%; | |
| position: relative; | |
| overflow: hidden; | |
| `; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async function setUpLights() { | |
| const lightingDevice = await navigator.usb.requestDevice({ filters: [] }); | |
| await lightingDevice.open(); | |
| await lightingDevice.claimInterface(0); | |
| // This comes from https://github.com/NERDDISCO/webusb-dmx512-controller | |
| lightingDevice.controlTransferOut({ | |
| // It's a USB class request | |
| requestType: "class", | |
| // The destination of this request is the interface |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // animationValue is a number from 0 to 1, generated by a tweener | |
| // In this case, I'm using a useAnimation hook. | |
| function calculateAnimationValue(animationValue, arcLength, arcStart) { | |
| // Figure out where the animation starts | |
| const animationStart = arcStart / 360; | |
| // If our arc starts after where the animation currently is, return 0 | |
| // This renders an invisible arc. | |
| if (animationValue < animationStart) { | |
| return 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react' | |
| export default function useCounter(initialCount) { | |
| const [time, setTime] = React.useState(initialCount); | |
| // The timer might not be exactly 1000 ms, so track the time | |
| // between intervals manually | |
| const lastTimeRef = React.useRef(Date.now()) | |
| // This effect resets the timer to the initial count when it changes. | |
| React.useEffect(() => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Hi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Preview | |
| simulatorId={this.props.simulator.id} | |
| tacticalMapId={this.state.tacticalMapId} | |
| layers={selectedTactical.layers} | |
| layerId={this.state.layerId} | |
| selectObject={this.selectObject} | |
| objectId={this.state.objectId} | |
| updateObject={this.updateObject} | |
| removeObject={this.removeObject} | |
| updatePath={this.updatePath} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test |