This file contains 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 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 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
const otpIsValid = (context, event) => { | |
return context.otpSent && event.otp && event.otp.length === 6; | |
} | |
const otpIsNotValid = (context, event) => { | |
return !context.otpSent || !event.otp || event.otp.length !== 6; | |
} | |
const CardStatusMachine = Machine( | |
{ | |
id: "Card Status" , |
This file contains 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
#!/usr/bin/env node | |
console.log("exec js from gist inside terminal"); |
This file contains 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
const crypto = require('crypto'); | |
const key = crypto.randomBytes(32); | |
const iv = crypto.randomBytes(16); | |
const algorithm = 'aes-256-cbc' | |
class Safe { | |
constructor(key, iv) { | |
this.key = key, | |
this.iv = iv | |
} | |
encrypt (text) { |