Skip to content

Instantly share code, notes, and snippets.

View astavonin's full-sized avatar

Alexander Stavonin astavonin

View GitHub Profile
@bench
bench / update-alternatives-golang.sh
Last active October 31, 2023 09:55
update-alternatives golang
#!/bin/bash
#
# Use the following script using sudo to install multiple golang installations on your debian
# update-alternatives creates, removes, maintains and displays information about the symbolic links comprising the alternatives system
# Usage : sudo ./full_golang_install.sh
#
if [[ $(id -u) -ne 0 ]] ; then echo "This script should be run using sudo or as the root user" ; exit 1 ; fi
## Configuration and init
@Integralist
Integralist / Let Destructuring.md
Last active February 13, 2023 19:35
Clojure destructuring using `let` (which allows local storage inside of a function, we would say a local "variable" but that would be misleading because all data is immutable in Clojure)

In Clojure you can apply destructuring within either a let binding list; function parameter list or even a macro.

A simple example would be:

(def coords [5 7]) ; define a symbol "coords" that points to a vector [5 7]
(let [[x y] coords] (println "x:" x "y:" y))
; => x: 5 y: 7