"Clojure running on Raspberry Pi" sounded so cool that I just had to give it a try.
- Download ARM JDK from Oracle and instlal on Raspberry Pi
- Change visudo to contain the following
This assumes you are now connected to the server via SSH.
sudo -s
Enter root mode for admin accessgroupadd devgroup
Create new group to be later granted access to /var/www/htmluseradd -G root,devgroup masterdev
Create new root user. Also add to the devgrouppasswd masterdev
Change password for the new root userimport Foundation | |
import AudioToolbox | |
class KKSimplePlayer: NSObject { | |
var URL: NSURL | |
var URLSession: NSURLSession! | |
var packets = [NSData]() | |
var audioFileStreamID: AudioFileStreamID = nil | |
var outputQueue: AudioQueueRef = nil | |
var streamDescription: AudioStreamBasicDescription? |
FROM clojure:openjdk-15-tools-deps AS builder | |
WORKDIR /opt | |
ADD deps.edn deps.edn | |
RUN clj -Sdeps '{:mvn/local-repo "./.m2/repository"}' -e "(prn \"Downloading deps\")" | |
RUN clj -e :ok | |
COPY . . | |
RUN clj -e :ok |
These resources (articles, books, and videos) are useful when you're starting to learn the language, or when you're learning a specific part of the language. This an opinionated list, no doubt. I've compiled this list from writing and teaching Clojure over the last 10 years.
struct MyView: View { | |
@StateObject var myValue = store.subscribe() | |
.map { state in state.myValue } | |
.toObservableObject(animation: .interactiveSpring()) // optional animation | |
@StateObject var myDerivedValue = store.subscribe() | |
.map { state in state.myValue } | |
.removeDuplicates() | |
.map { value in complexTransformation(value) } // triggered only on new value | |
.toObservableObject() |
;;=============== play with flow ============== | |
(require '[clojure.core.async :as async] | |
'[clojure.core.async.flow :as flow] | |
'[clojure.pprint :as pp] | |
'[clojure.datafy :as d] | |
'[clojure.walk :as w]) | |
(set! *warn-on-reflection* true) | |
(defn monitoring [{:keys [report-chan error-chan]}] |