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
;; In "pil +" | |
(be aaa (1 2)) | |
(be aaa (2 3)) | |
(be aaa (@X @Z) (@X @Y) (@Y @Z)) | |
(? (aaa 1 4)) | |
;; After last line process completely hangs taking 100% CPU. | |
;; I cannot even kill it except "kill -9" |
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
;; A version of zipper that allows mixing maps and vectors | |
;; Note that it traverses map entries too | |
(require '[clojure.zip :as z]) | |
(defn map-vec-zipper [m] | |
(z/zipper | |
(fn [x] (or (map? x) (sequential? x))) | |
seq | |
(fn [p xs] | |
(if (isa? (type p) clojure.lang.MapEntry) | |
(into [] xs) |
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
(require '[manifold.deferred :as d]) | |
(require '[manifold.stream :as s]) | |
(require '[aleph.http :as http]) | |
(require '[clojure.core.async :as a]) | |
(require '[byte-streams :as bs]) | |
(def oauth-token "asdfasdfsadfasdfasdfsadfsad") | |
(defn get-stream [] | |
(http/request |
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
import RPi.GPIO as GPIO | |
import time | |
import sys | |
pir = int(sys.argv[1]) | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setup(pir, GPIO.IN) | |
print("PIN", pir) | |
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
# <requires root> | |
apt install cryptsetup | |
blkid | grep 'crypto_LUKS' | |
# encrypted device --> LUKS device mapper --> mapped device --> mount | |
# to mount | |
cryptsetup luksOpen /dev/sda1 my-decrypted-storage | |
mount -t auto /dev/mapper/my-decrypted-storage /media/storage |
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
package com.company; | |
import java.util.Arrays; | |
public class ArrayAdd { | |
public static int[] incArray(int[] digits, int base) { | |
assert base > 0; | |
final int[] result = new int[digits.length + 1]; | |
int carry = 1; // Increment value | |
for (int i = digits.length - 1; i >= 0; i--) { |
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
{:user {:dependencies [[pjstadig/humane-test-output "0.8.1"]] | |
:injections [(require 'pjstadig.humane-test-output) | |
(pjstadig.humane-test-output/activate!)] | |
:plugins [[lein-auto "0.1.2"] | |
[jonase/eastwood "0.2.3"] | |
[lein-kibit "0.1.2"] | |
[lein-ancient "0.6.10"] | |
[lein-cloverage "1.0.9"] | |
[lein-environ "1.1.0"] | |
[lein-pprint "1.1.2"] |
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
docker create -p 127.0.0.1:5000:5000 --name registry registry | |
docker start registry |
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
export PGPASSWORD=a-postgres-password |