marp |
---|
true |
View overload.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
#![feature(fn_traits, unboxed_closures)] | |
macro_rules! orelse { | |
(($($lhs:tt)+), $rhs:tt) => {$($lhs)+}; | |
((), ($($rhs:tt)*)) => {$($rhs)*} | |
} | |
macro_rules! overload { | |
( | |
$v:vis fn $fn_name:ident { |
View escape_non_utf8_paths.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
/* POSIX paths in JSON via escaping which | |
doesn't alter valid UTF-8 paths. | |
The trick is recognizing that JSON can store binary nulls in strings | |
but nulls are the only character that can't occur in POSIX paths, | |
so we can use it as an escape character that won't change how existing | |
serialized paths get interpreted. | |
Copyright 2018-2020, Stephan Sokolow |
View nostd-brainfuck.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
#[derive(Copy, Clone)] | |
enum LinkedList<'a> { | |
Nil, | |
Cons(u8, &'a LinkedList<'a>), | |
} | |
struct LinkedListIter<'a> { | |
list: LinkedList<'a>, | |
} |
View starship.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
# ~/.config/starship.toml | |
[battery] | |
full_symbol = "🔋" | |
charging_symbol = "🔌" | |
discharging_symbol = "⚡" | |
[[battery.display]] | |
threshold = 30 | |
style = "bold red" |
View marp.md
View Angle.cs
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
namespace Vector2Example | |
{ | |
using System; | |
using GalaSoft.MvvmLight; | |
public class Angle : ObservableObject | |
{ | |
private Angle() { } | |
public static Angle FromRadians(double radians) | |
{ |
View rr-with-rust.md
using rust with rr
rr
is a great debugging tool. it records a trace of a program's execution, as well as the results of
any syscalls it executes, so that you can "rewind" while you debug, and get deterministic forward and reverse
instrumented playback. it works with rust, but by default if you try it out, it could be pretty ugly when you
inspect variables. if this bothers you, configure gdb to use a rust pretty-printer
rr
is probably in your system's package manager.
usage
View .travis.yml
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
language: rust | |
rust: | |
- nightly | |
cache: cargo | |
services: | |
- postgresql | |
before_script: | |
- psql -c 'create database build_db;' -U postgres | |
- echo "DATABASE_URL=postgres://postgres@localhost/build_db" > .env | |
- cargo install diesel_cli --no-default-features --features=postgres |
NewerOlder