I hereby claim:
- I am snorremd on github.
- I am snorremd (https://keybase.io/snorremd) on keybase.
- I have a public key ASD_4XYCom9uHTi1LegqEqSMDqO0PKkdi_pI6Siy4OZwFgo
To claim this, I am signing this object:
| // Make it extend sync to handle multiple go routines | |
| type Broadcaster struct { | |
| sync.Mutex | |
| clients map[string]chan models.CreatePostEvent | |
| } | |
| // Constructor | |
| func NewBroadcaster() *Broadcaster { | |
| return &Broadcaster{ | |
| clients: make(map[string]chan models.CreatePostEvent), |
| ;; Documents how to handle time and interval postgres types with next.jdbc library | |
| ;; See more docs here: https://cljdoc.org/d/com.github.seancorfield/next.jdbc/1.1.646/doc/getting-started/result-set-builders | |
| (ns yourapp.db | |
| (:require [next.jdbc.result-set :as rs] | |
| [next.jdbc.prepare :as p] | |
| [next.jdbc.date-time :refer [read-as-local]] | |
| [tick.core :as tick]) | |
| (:import [org.postgresql.util PGInterval] | |
| [java.sql PreparedStatement])) |
| (-> (zip/zipper vector? | |
| seq | |
| (fn [_ children] children) | |
| []) | |
| (zip/append-child 1) | |
| (zip/append-child 2)) |
| #!/usr/bin/env bb | |
| (defn random-bytes | |
| [n] | |
| (with-open [in (io/input-stream (io/file "/dev/urandom"))] | |
| (let [buf (byte-array n)] | |
| (.read in buf) | |
| buf))) | |
| (defn random-number |
| #!/usr/bin/env bb | |
| (def md-head-template | |
| "--- | |
| path: \"/blog/%s\" | |
| date: \"%s\" | |
| title: \"%s\" | |
| --- | |
| ") |
| FROM clojure:openjdk-11-tools-deps-1.10.0.442 as builder | |
| WORKDIR /app | |
| # Install deps | |
| COPY ./deps.edn ./ | |
| RUN clojure -Abuild -e "(clojure-version)" | |
| # Compile Clojure code | |
| ADD . /app |
| #!/usr/bin/env bash | |
| # cljgp is a script for decrypting a credentials file with environment | |
| # variables and set them on the clj process. Combine this with the | |
| # ~/.m2/settings.xml file and tell maven to use your environment vars: | |
| # https://maven.apache.org/settings.html. | |
| # | |
| # Credentials file should contain: | |
| # MY_USER=someuser | |
| # MY_PASS=somepass |
I hereby claim:
To claim this, I am signing this object:
| # notify-desktop shit | |
| notify() { | |
| osascript -e "display notification \"$2\" with title \"$1\"" | |
| } | |
| alias display-notification=notify |
| var webdriverio = require('webdriverio'), | |
| moment = require('moment'); | |
| var options = { | |
| desiredCapabilities: { | |
| browserName: 'firefox' | |
| } | |
| }; | |
| var password = process.env.FACEBOOK_PASSWORD, | |
| email = process.env.FACEBOOK_EMAIL, |