Skip to content

Instantly share code, notes, and snippets.

View GoldsteinE's full-sized avatar

Max “Goldstein” Siling GoldsteinE

View GitHub Profile
// Problem:
macro_rules! generate_impl {
($x:ident) => {
unsafe impl cxx::ExternType for $x {
// Won't work, `type_id!()` wants a literal, not a macro call
type Id = cxx::type_id!(stringify!($x));
type Kind = cxx::kind::Trivial;
}
};
}
use v5.18;
use strict;
use warnings;
use diagnostics;
use Getopt::Long;
sub must($$) {
my ($name, $val) = @_;
diff --git a/rivertile/main.zig b/rivertile/main.zig
index d1149b1..5e61686 100644
--- a/rivertile/main.zig
+++ b/rivertile/main.zig
@@ -66,6 +66,17 @@ pub fn main() !void {
const output_width = try std.fmt.parseInt(u32, std.mem.spanZ(args[width_arg]), 10);
const output_height = try std.fmt.parseInt(u32, std.mem.spanZ(args[height_arg]), 10);
+ // Buffering the output makes things faster
+ var stdout_buf = std.io.bufferedOutStream(std.io.getStdOut().outStream());
Place your cursor on the line 6 and type 0"qy$@q to execute brainfuck code in line 9.
Memory begins from line 22, you can add zeroes here to increase available amount.
Line 21 is output. There is no input. Negative numbers are not supported.
Plugins / remaps can break the interpreter. Run this with -u NONE.
j0"sy$jjmcjmo/^catch jmz0"_d$jmd/catch kk$s0@s
`c"cyl'o/\M^c W"cy$'d@c`clmc@s
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.
error: captured variable cannot escape `FnMut` closure body
--> components/rendering/src/markdown.rs:208:17
|
176 | let mut highlighter: Option<CodeBlock> = None;
| --------------- variable defined here
...
197 | .map(|event| {
| - inferred to be a `FnMut` closure
...
208 | / Ok(Either::Right(events.into_iter().map(|event| {
#!/usr/bin/env sh
bounds="$(slop -b 0 -lc 0.1,0.6,0.8,0.4 -qf '%x,%y,%w,%h' 2>/dev/null)"
[ "$?" -eq "0" ] || exit 0
filename="$(date +'%Y-%m-%dT%H.%M.%S')_$(pwgen 5 1).png"
screenshot_dir="${SCREENSHOT_DIR:-$HOME/Pictures/Screenshots}"
mkdir -p "$screenshot_dir"
scrot -a "$bounds" "$screenshot_dir/$filename"
@GoldsteinE
GoldsteinE / r2.md
Created February 24, 2021 16:19
Языки программирования, про которые вы (возможно) не знали — выпуск 2

Языки программирования, про которые вы (возможно) не знали — выпуск 2

Язык первый, практичный — Zig

Сайт: https://ziglang.org

Zig is a general-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.

Официальный сайт Zig

@GoldsteinE
GoldsteinE / r1.md
Created February 16, 2021 15:40
Языки программирования, про которые вы (возможно) не знали — выпуск 1

Языки программирования, про которые вы (возможно) не знали — выпуск 1

Язык первый, практичный — Nim

Сайт: https://nim-lang.org

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula.

Официальный сайт Nim

use super::suggest;
use super::MethodError;
use super::NoMatchData;
use super::{CandidateSource, ImplSource, TraitSource};
use crate::check::FnCtxt;
use crate::errors::MethodCallOnUnknownType;
use crate::hir::def::DefKind;
use crate::hir::def_id::DefId;