Skip to content

Instantly share code, notes, and snippets.

View brudil's full-sized avatar
🦋
making things better

James Canning brudil

🦋
making things better
View GitHub Profile
@brudil
brudil / machine.js
Last active August 19, 2020 13:48
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
import { Schema } from '@upbeat/schema/src';
import {
UpbeatId,
UpbeatResource,
RealisedResource,
UpbeatString,
UpbeatBoolean,
UpbeatOrderable,
UpbeatSet,
@brudil
brudil / machine.js
Created November 25, 2019 20:21
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
const Freshers = () => {
const { seconds, minutes, hours, days } = useCountdown(new Date(2019, 11, 6));
return (
<div>
<div>{days}</div>
<div>Days</div>
<div>{hours}</div>
<a href="https://google.com/" class="Button">Vist Google</a>
<div class="search-app-root"></div>
<script src="https://kings-search.netlify.com/src.416cc178.js"></script>
{
"threads": {
"43534": {
"members": {
"3454": {
"modules": {
"important": {
"hasSeen": false,
}
}
@brudil
brudil / bot.py
Last active August 15, 2018 20:22
bot = Bot()
# register adds the function to the bot
# accepts a tuple of different triggers
@bot.register(('!weather {location?}', '☀️')) # question mark means it isn't required
def weather(msg, res, location = 'brighton'): # arguments get passed in after msg, res.
data = requests.get(f'weatherapi.com/{location}')
# msg contains all data related to the message sent
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<link href="https://fonts.googleapis.com/css?family=Lato:900" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/lodash/4/lodash.min.js"></script>
</head>
{
"compileOnSave": false,
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"lib": [
"dom",
"es2015",
"es2016",
"es2017"
],