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 | |
set -euo pipefail | |
shopt -s inherit_errexit | |
mkdir -p ~/.cache/mrhlpr | |
case "${1:-}" in | |
'fixmsg') | |
if [ -n "$(git status --porcelain)" ]; 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
# ~/src/non-oss-container/build.sh | |
#!/bin/bash | |
set -euo pipefail | |
mkdir -p ~/non-oss-root/ | |
podman image rm --force localhost/non-oss || : |
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
#!/usr/bin/awk -f | |
BEGIN { | |
while (1) { | |
split(exec_line_match("ip addr show dev eth0", " inet "), ip_a_parts, " ") | |
split(ip_a_parts[2], ip_value_parts, "/") | |
split(ip_value_parts[1], ip_parts, ".") | |
reset(); |
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
browser.runtime.onMessage.addListener(async message => { | |
const { param } = message; | |
switch (param) { | |
case "get": | |
return getRecords(); | |
case "set": | |
return setRecords(message.records); |
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
# /etc/init.d/gps-nmea | |
#!/sbin/openrc-run | |
command=/usr/local/bin/gps-nmea.py | |
command_args= | |
command_background=true | |
pidfile="/run/${RC_SVCNAME}.pid" |
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
// If lines 72 and 73 are uncommented and 74 is commented out, the assert on line 77 succeeds (as expected). | |
// If lines 72 and 73 are commented out and 74 is uncommented, the assert on line 77 fails. | |
// | |
// $ zig run -O Debug ./main.zig | |
// | |
// Linux x86_64, 0.9.0-dev.2010+e8b39960b | |
const std = @import("std"); | |
const Scanner = struct { |
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 = "transducers" | |
version = "0.1.0" | |
authors = ["Arnavion <me@arnavion.dev>"] | |
edition = "2018" | |
[dependencies] | |
num-traits = { version = "0.2", default-features = false } | |
[dev-dependencies] |
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
async function any<T>(promises: Promise<T>[]): Promise<T> { | |
const rejections: any[] = []; | |
for (const promise of promises) { | |
try { | |
return await promise; | |
} | |
catch (reason) { | |
rejections.push(reason); | |
} |
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
async function first<T>(promises: Promise<T>[]): Promise<T> { | |
const rejections: any[] = []; | |
for (const promise of promises) { | |
try { | |
return await promise; | |
} | |
catch (reason) { | |
rejections.push(reason); | |
} |
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
#![deny(rust_2018_idioms, warnings)] | |
#![deny(clippy::all, clippy::pedantic)] | |
//! This crate defines a `launder` macro that can be used to create a borrow that is scoped to the block where this macro is invoked, | |
//! even if the expression to create the borrow returns a `'static` borrow. | |
/// This macro can be used to create a borrow that is scoped to the block where this macro is invoked, | |
/// even if the expression to create the borrow returns a `'static` borrow. | |
/// | |
/// For example, dereferencing a raw pointer with `&*` creates a borrow with an arbitrary lifetime which can be `'static`. |
NewerOlder