sudo apt-get update && sudo apt-get install -y build-essential libssl-dev uuid-dev \
libgpgme11-dev squashfs-tools libseccomp-dev wget pkg-config git cryptsetup
This file contains 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
const std = @import("std"); | |
const print = std.debug.print; | |
var yielded = false; | |
fn yield() void { | |
yielded = true; | |
suspend; | |
} |
This file contains 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
defmodule Lisp do | |
@type ast :: [String.t | number | ast] | |
@type token :: :lp | :rp | number | String.t | |
@letters Enum.concat(?a..?z, ?A..?Z) | |
@numbers ?0..?9 | |
@operators [?+] | |
@doc """ |
This file contains 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
using JSON | |
#make sure we have what we're looking for. | |
(length(ARGS) == 0) && throw(ErrorException("needs a file name")) | |
################################### | |
#rows iterator | |
type rows; tgt::Matrix; end | |
Base.start(r::rows) = 1 | |
Base.next(r::rows, idx) = (r.tgt[idx, :], idx + 1) | |
Base.done(r::rows, idx) = idx > size(r.tgt, 1) |
This file contains 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
//! The Computer Language Benchmarks Game | |
//! https://salsa.debian.org/benchmarksgame-team/benchmarksgame/ | |
//! | |
//! This implementation is written in simple and idiomatic Zig. | |
//! The only optimization is using SIMD vector intrinsics. | |
const std = @import("std"); | |
///////////////////////////////////////////////////////////////////////// | |
// important constants. ALLCAPS constants are not idiomatic Zig, but it's |
This file contains 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
{ | |
"Inspect": { | |
"prefix": "ins", | |
"body": "|> IO.inspect(label: \"$0$TM_LINE_NUMBER\")", | |
"description": "Adds a pipeline with a labelled `IO.inspect`", | |
} | |
} |
This file contains 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
#!/bin/sh | |
IMAGE=<your image id> | |
CMD=<your cmd> | |
podman run --net host -v $HOME:$HOME -e HOME="$HOME" -w$(PWD) -it $IMAGE "$CMD $@" |
This file contains 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
(length(ARGS) < 4) && (println("error, insufficient arguments"); exit(1)) | |
infile, column, replace, outfile = ARGS | |
function replace_column(idx) | |
(idx == 0) && (println("column name doesn’t exist in the input file"); exit(1)) | |
mtx2 = copy(mtx) | |
mtx2[2:end,idx] = collect(Iterators.repeated(replace,size(mtx,1) - 1)) | |
mtx2 |
This file contains 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
defmodule T do | |
def find_first_free(arr), do: find_first_free(arr, 0, []) | |
def find_first_free([], lowest_free, _leftovers), do: lowest_free | |
def find_first_free([head | tail], lowest_free, leftovers) do | |
if (lowest_free == head) do | |
find_first_free(tail, lowest_free + 1, leftovers) | |
else | |
find_first_free(tail, lowest_free, [head | leftovers]) | |
end | |
end |
This file contains 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
function simplify(e::Expr) | |
if e.head == :call | |
if e.args[1] == :+ | |
simplify_add(e) | |
end | |
end | |
end | |
function simplify_add(e::Expr) | |
terms = Dict{Symbol, Int}() |