Skip to content

Instantly share code, notes, and snippets.

View leeovery's full-sized avatar
🎯
Focusing

Lee Overy leeovery

🎯
Focusing
View GitHub Profile
<?php /** @noinspection PhpUndefinedMethodInspection */
namespace App\Console\Commands;
use Altek\Accountant\Context;
use Altek\Accountant\Notary;
use App\Models\Audit;
use App\Models\Ledger;
use Illuminate\Console\Command;
@leeovery
leeovery / machine.js
Last active August 1, 2020 16:55
Generated by XState Viz: https://xstate.js.org/viz
const conversationMachine = Machine({
id: 'ConversationMachine',
initial: 'idle',
context: {
Yap: undefined,
User: undefined,
},
// either sending messages, receiving messages, or neither.
// can send and receive at same time.
@leeovery
leeovery / machine.js
Last active July 25, 2020 10:14
Generated by XState Viz: https://xstate.js.org/viz
const yapsMachine = Machine({
id: 'yaps',
initial: 'loading',
context: {
User: {},
yaps: null,
Yap: null,
},
states: {
loading: {
@leeovery
leeovery / machine.js
Last active July 25, 2020 10:18
Generated by XState Viz: https://xstate.js.org/viz
const messagingMachine = Machine({
id: 'messaging',
initial: 'idle',
context: {
//
},
// either sending messages, receiving messages, or neither.
// can send and receive at same time.
type: 'parallel',
states: {
@leeovery
leeovery / machine.js
Last active August 3, 2020 12:10
Generated by XState Viz: https://xstate.js.org/viz
const YapsMachine = Machine({
id: 'yap',
initial: 'unknown',
context: {
Yap: {
id: 123,
status: {
description: 'New'
}
},
@leeovery
leeovery / logMachineTransitions.js
Last active July 20, 2022 20:05
xstate console logger
import typeOf from 'just-typeof';
const colors = {
heading: '#86c0d1',
title: '#80a0c2',
subtitle: '#a2bf8a',
body: '#d8dee9',
};
const styles = {
@leeovery
leeovery / machine.js
Last active August 26, 2020 18:40
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: 'fetch',
initial: 'ready',
context: {
retries: 0
},
states: {
ready: {
invoke: {
src: 'listenForTypingOnChannel',
@leeovery
leeovery / machine.js
Last active August 27, 2020 18:13
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: 'fetch',
initial: 'ready',
context: {},
states: {
ready: {
invoke: [{
src: 'listenForRecipientTyping',
@leeovery
leeovery / mysql-docker.sh
Created September 14, 2020 14:53 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@leeovery
leeovery / gist:1c591d82021de756d1dfed3b9cc708df
Created August 13, 2021 19:14 — forked from kapkaev/gist:4619127
MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error. Resque
$ redis-cli
> config set stop-writes-on-bgsave-error no