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
diff --git a/src/art.rs b/src/art.rs | |
index 78e28bf..970b0e0 100644 | |
--- a/src/art.rs | |
+++ b/src/art.rs | |
@@ -813,6 +813,7 @@ impl MarginChecker { | |
#[derive(Debug, Clone)] | |
pub struct Point { | |
+ pub group_idx: u32, | |
pub position: (f64, f64), |
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
diff --git a/src/art.rs b/src/art.rs | |
index 78e28bf..aaf353f 100644 | |
--- a/src/art.rs | |
+++ b/src/art.rs | |
@@ -213,7 +213,7 @@ impl ColorChangeOdds { | |
} | |
} | |
-#[derive(Debug)] | |
+#[derive(Debug, Clone)] |
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 std::collections::{HashMap, HashSet}; | |
struct Pawn; | |
struct Bishop; | |
struct Rook; | |
struct Monarch; | |
struct Knight; | |
/// A subset of the squares on a chess board. | |
/// |
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
import { createContext, useContext, useRef } from "react"; | |
const TelescrollContext = createContext({ | |
provideScroll: () => {}, | |
requestScroll: () => {}, | |
}); | |
export function TelescrollProvider({ children }) { | |
const requested = useRef(null); |
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
// Visually looks like an ellipsis, like "0x123...def", but the underlying text | |
// actually has the whole address, so when you select it to copy-paste you get | |
// the whole thing. | |
const ShortAddress = ({ address, ensAddress }) => { | |
if (ensAddress != null) return <span>{ensAddress}</span>; | |
const nibbles = 3; // to keep, at each side | |
const prefix = "0x".length; | |
const start = address.slice(0, prefix + nibbles); | |
const mid = address.slice(prefix + nibbles, -nibbles); |
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
import shlex | |
import subprocess | |
BIN = "./target/release/qql-cli" | |
SEED = "0x44266f38ea9ef4e85a77310518b1cb6d5a56349bed2514b9d9e2ffff10e2cb2f" | |
WIDTH = 2400 | |
STEPS = 8 | |
def lerp(a, b, t): |
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
[Unit] | |
Description=Continuous audio recorder | |
After=network-online.target | |
Wants=network-online.target | |
[Service] | |
ExecStart=/home/pi/start.sh | |
WorkingDirectory=/home/pi | |
User=pi | |
Group=pi |
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
let g:airline_section_gutter = "%{MyStatuslineFunction()}%=" | |
function! MyStatuslineFunction() | |
if &l:ft != "haskell" | |
return "nope" | |
else | |
let l:file = expand("%") | |
if l:file == '' | |
return "" | |
endif | |
if !filereadable(l:file) |
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/sh | |
rustc +nightly --crate-type=staticlib forty_two.rs || exit 1 | |
gcc main.c -L. -lforty_two || exit 1 | |
./a.out | |
# prints: forty_two() = 42 |
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 | |
# Extended from a work of Jürgen Hötzel: https://stackoverflow.com/a/2613888 | |
noise_threshold=15 # out of 99 | |
base_dir="${HOME}/recordings" | |
raw_dir="${base_dir}/tmp" | |
chunk_dir="${base_dir}/chunks" | |
seg_dir="${base_dir}/seg" | |
out_dir="${base_dir}/out" | |
sox_raw_options=( -t raw -r 48k -e signed -b 16 -c 1 ) |