Slides accompanying my presentation NixOS: a sales pitch.
View nixos-outdated.nix
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
{ pkgs ? import <nixpkgs> { } }: | |
pkgs.writeShellScriptBin "nixos-outdated" '' | |
nixos-rebuild dry-build 2>&1 \ | |
| ${pkgs.gnugrep}/bin/grep /nix/store \ | |
| ${pkgs.coreutils}/bin/cut -d '/' -f 4 \ | |
| ${pkgs.coreutils}/bin/cut -d '-' -f 2- \ | |
| ${pkgs.coreutils}/bin/sort | |
'' |
View Cargo.toml
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
[package] | |
name = "sandbox" | |
version = "0.1.0" | |
authors = ["User Name <foo@bar>"] | |
edition = "2018" | |
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |
[features] | |
profiling = ["funtime"] |
View error.log
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
error[E0277]: the trait bound `(): warp::reply::Reply` is not satisfied | |
--> oon_web/src/main.rs:133:5 | |
| | |
133 | warp::serve(routes).run(([127u8, 0, 0, 1], port)).await; | |
| ^^^^^^^^^^^ the trait `warp::reply::Reply` is not implemented for `()` | |
| | |
::: /home/justinas/.cargo/git/checkouts/warp-4a034a455cef9a29/5c26956/src/server.rs:26:8 | |
| | |
26 | S: IntoWarpService + 'static, | |
| --------------- required by this bound in `warp::server::serve` |
View keybase.md
Keybase proof
I hereby claim:
- I am justinas on github.
- I am justinas (https://keybase.io/justinas) on keybase.
- I have a public key whose fingerprint is E20A 88AF 681D 9244 AB3A 49CE 2715 B54B 10AB 8911
To claim this, I am signing this object:
View guessing_game.rs
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
use nmatoolkit::random::generate_i64; | |
use nmatoolkit::io3::read_i64; | |
fn main() { | |
let min_bound: i64 = 0; | |
let max_bound: i64 = 10; | |
let num = generate_i64(min_bound, max_bound); | |
println!("Spėk!"); | |
println!("{}", if match read_i64() {Ok(i) => i, Err(e) => {println!("Error: {}", e); num - 1},} == num {"Pasisekė..."} else { "Nepataikei. Gal netaiklus?"}); | |
} |
View enum_len.rs
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
/// Defines an enum and implements a static function for it | |
/// that returns the number of variants it can take. | |
macro_rules! enum_len { | |
// 'Public API': 0 variants | |
($name:ident, []) => { | |
enum_len!($name, [], [], 0); | |
}; | |
// 'Public API': 1 variant | |
($name:ident, [$first:ident]) => { |
View gist:ff7089e91ca2035c7199
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
$ cat a.rs; xgettext a.rs -o - | |
fn main() { | |
catalog.gettext("Cucumber"); | |
catalog.ngettext("Cucumber", "Cucumbers", 42); | |
catalog.pgettext("a vegetable", "Cucumber"); | |
catalog.npgettext("a vegetable", "Cucumber", "Cucumbers", 42); | |
gettext!("Hi"); | |
} | |
xgettext: warning: file 'a.rs' extension 'rs' is unknown; will try C |
View keybase.md
Keybase proof
I hereby claim:
- I am justinas on github.
- I am justinas (https://keybase.io/justinas) on keybase.
- I have a public key whose fingerprint is E20A 88AF 681D 9244 AB3A 49CE 2715 B54B 10AB 8911
To claim this, I am signing this object:
View htmlTemplateMock.go
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
/* | |
Basically, while writing a web app in Go I felt that | |
templates were the most undertested part of it. | |
I have no checks whether a handler actually executes a template, | |
is it the right one, is the correct context passed, etc. | |
This kind of mock provides a way to make lots of these checks. | |
*/ | |
type Executable interface{ |
NewerOlder