Skip to content

Instantly share code, notes, and snippets.

@GaspardP
GaspardP / sops-git-diff.sh
Created December 16, 2019 14:54
Diff of SOPS file between two git branches
diff \
<(sops -d <(git --no-pager show origin/master:foobar.sops)) \
<(sops -d <(git --no-pager show origin/mybranch:foobar.sops))
@GaspardP
GaspardP / alpha.spec as lein dependency.md
Last active March 7, 2020 11:02
alpha.spec (org.clojure/spec-alpha2) as lein dependency (local install using a maven deploy-file)

Create a local maven repository

To isolate local artifacts from downloaded one we create a local equivalent of ~/.m2/repositories.

mkdir -p ~/.m2/local

Install spec-alpha2 in the local repository

@GaspardP
GaspardP / sha256.js
Created June 4, 2015 15:21
SHA-256 with Javascript and Web Crypto
// Computes the SHA-256 digest of a string with Web Crypto
// Source: https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest
function sha256(str) {
// Get the string as arraybuffer.
var buffer = new TextEncoder("utf-8").encode(str)
return crypto.subtle.digest("SHA-256", buffer).then(function(hash) {
return hex(hash)
})
}