Este texto é inspirado em A Half Hour to Learn Rust.
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/bash | |
tmp=$(python -c "import os, sys; print(os.path.realpath('/tmp'))") | |
function test { | |
MESSAGE=$1 | |
RECEIVED=$2 | |
EXPECTED=$3 | |
if [ "$RECEIVED" = "$EXPECTED" ]; then |
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
fn is_prime(comptime T: type, | |
n: T) bool { | |
var d: T = 2; | |
var exausted: bool = false; | |
var found: bool = false; | |
if (n < 0) return is_prime(-n); | |
if (n == 0 or n == 1) return false; |
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/fish | |
# pdf2zip.fish | |
function usage | |
printf " | |
Usage: pdf2zip.fish [Only one PDF file] | |
Transforms a single PDF file, passed under cmdline, to an equivalent ZIP file, | |
storing it in the current directory" |
This is a project structure I’ve found useful. Looking for any
thoughts/comments/feedback. Roughly, I found a tension between the style
nixpkgs expects and the style conducive to development, so I extracted the
common portion into a derivation.nix
which is used by the remaining .nix
files. This setup allows me to use nix build
, nix-shell
, overlays, Hydra,
alternate packaging schemes, cross-compiling, etc.
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/fish | |
# rar2zip.fish | |
function usage | |
printf " | |
Usage: rar2zip.fish [Only one RAR file] | |
Transforms a single RAR file, passed under cmdline, to an equivalent ZIP file, | |
storing it in the current directory" |