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
| (ns clj-current-music-lyrics.core | |
| (:require [clj-http.client :as client] | |
| [clojure.data.json :as json]) | |
| (:gen-class)) | |
| (def apikey "Bearer YOUR_API_KEY") | |
| (defn -main | |
| "main fn" | |
| [& args] |
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
| ;;; Stack structure definition | |
| (define nil '()) | |
| (define (stack . items) | |
| (apply list items)) | |
| (define (push stack item) | |
| (cons item stack)) | |
| (define (pop stack) |
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
| (define (square x) (* x x)) | |
| ;; (define (square x) (* x x)) | |
| ;; | | | | | | | |
| ;; To square something, multiply it by itself. |
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
| // 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
| const signatureMachine = Machine({ | |
| id: 'signature', | |
| initial: 'init', | |
| context: { | |
| signature: null, | |
| isExpectedRecipient: null | |
| }, | |
| states: { | |
| init: { | |
| on: { |
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
| const signatureMachine = Machine({ | |
| id: 'signature', | |
| initial: 'init', | |
| context: { | |
| signature: null, | |
| isExpectedRecipient: null | |
| }, | |
| states: { | |
| init: { | |
| on: { |
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
| const SSTATES = { | |
| loadingStep: 'loadingStep', | |
| successStep: 'successStep', | |
| offlineStep: 'offlineStep', | |
| redirectStep: 'redirectStep' | |
| }; | |
| const AACTIONS = { | |
| REDIRECT: 'REDIRECT' | |
| }; |
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
| const protocolMachine = Machine( | |
| { | |
| id: 'protocol', | |
| initial: 'signature', | |
| context: { | |
| // machine refs | |
| signatureMachineRef: null, | |
| recipientMachineRef: null, | |
| packageSyncMachineRef: null, |
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 | |
| // - XState (all XState exports) |