Skip to content

Instantly share code, notes, and snippets.

View Fishrock123's full-sized avatar
💭
#freepalestine #blacklivesmatter #acab drop ICE you cowards

Jeremiah Senkpiel Fishrock123

💭
#freepalestine #blacklivesmatter #acab drop ICE you cowards
View GitHub Profile
@Fishrock123
Fishrock123 / from_bash_env.nu
Last active February 19, 2024 05:54
from_bash_env.nu
def from_bash_env [$input] { $input | str replace -amr '(&&)|(\r\n)|\n|;' "\n" | lines -s | str trim | parse "export {name}='{value}'" | transpose -ird }
# from_bash-env (your commands) | load-env
@Fishrock123
Fishrock123 / lib.rs
Created September 14, 2023 21:00
rust_lint_rules.rs
#![forbid(unsafe_code)]
#![deny(future_incompatible)]
#![warn(
meta_variable_misuse,
missing_debug_implementations,
noop_method_call,
rust_2018_idioms,
trivial_casts,
unused_lifetimes,
unused_qualifications,
thread 'rustc' panicked at 'Found unstable fingerprints for mir_built(ea04a2c9f18d1c84-a3eaecb2025003d0): Steal { value: RwLock(RefCell { value: Some(Body { basic_blocks: BasicBlocks { basic_blocks: [BasicBlockData { statements: [StorageLive(_3), _3 = std::option::Option::<Vec<Redirect>>::None, FakeRead(ForLet(None), _3), AscribeUserType(_3, o, UserTypeProjection { base: UserType(1), projs: [] }), StorageLive(_4)], terminator: Some(Terminator { source_info: SourceInfo { span: src/lib.rs:405:33: 405:44 (#696), scope: scope[1] }, kind: goto -> bb1 }), is_cleanup: false }, BasicBlockData { statements: [], terminator: Some(Terminator { source_info: SourceInfo { span: src/lib.rs:405:33: 405:44 (#696), scope: scope[1] }, kind: falseUnwind -> [real: bb2, unwind: bb117] }), is_cleanup: false }, BasicBlockData { statements: [StorageLive(_6), StorageLive(_7), StorageLive(_8), StorageLive(_9), _9 = &mut _2, _8 = &mut (*_9)], terminator: Some(Terminator { source_info: SourceInfo { span: src/lib.rs:405:33: 405:44 (#696),
@Fishrock123
Fishrock123 / pre-commit
Created December 6, 2021 23:20
cargo-husky rustfmt pre-commit
#!/bin/sh
set -e
for file in $(git diff --name-only --cached --diff-filter=d | grep '\.rs$'); do
rustfmt --edition 2021 $file # this will NEVER age poorly
git add "$file"
done
@Fishrock123
Fishrock123 / Eaze_rust_lint_rules.rs
Last active July 12, 2022 20:48
Eaze rustc check & clippy lint rules
#![forbid(unsafe_code)]
#![deny(future_incompatible)]
#![warn(
missing_debug_implementations,
rust_2018_idioms,
trivial_casts,
unused_qualifications
)]
#![doc(test(attr(deny(rust_2018_idioms, warnings))))]
#![doc(test(attr(allow(unused_extern_crates, unused_variables))))]
@Fishrock123
Fishrock123 / cargo-json-output.json
Created April 27, 2020 19:42
`cargo doc` run on tide @ 28e5904 (0.8.0)
{
"reason":"compiler-message",
"package_id":"tide 0.8.0 (path+file:///Z:/Rust-Projects/tide)",
"target":{
"kind":[
"lib"
],
"crate_types":[
"lib"
],
@Fishrock123
Fishrock123 / iterators-break-recursion-loop.js
Created August 29, 2019 00:22
iterators-break-recursion-loop.js
function* f() {
try {
yield 1
yield 2
yield 3
} finally {
yield* f()
}
}
@Fishrock123
Fishrock123 / interator-break-finally-recursion.js
Created August 28, 2019 23:28
interator-break-finally-recursion.js
function* f() {
try {
yield 1
yield 2
yield 3
} finally {
yield* f()
}
}
@Fishrock123
Fishrock123 / iterator-break-yield-not-done.js
Created August 28, 2019 23:09
iterator-break-yield-not-done.js
function* f() {
try {
yield 1
yield 2
yield 3
} finally {
yield 4
yield 5
}
}
@Fishrock123
Fishrock123 / async-iterator-break-yield.js
Created August 28, 2019 23:06
async-iterator-break-yield.js
async function* f() {
try {
yield Promise.resolve(1)
yield Promise.resolve(2)
yield Promise.resolve(3)
} finally {
console.log('inside finally')
// yield Promise.resolve(4)
console.log('about to reject from finally')
yield new Promise((res, rej) => {