Table of Contents
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 | |
for f in *mkv; do | |
source="$f" | |
target=$(echo "$f" | sed -r 's/Modern Family S([[:digit:]]+)E([[:digit:]]+)[^.]*.mkv/Modern Family S\1E\2.mkv/') | |
echo "$source => $target" | |
mv "$source" "$target" | |
done |
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 BangPatterns #-} | |
module Main where | |
import Data.Void | |
-- We still need to pattern-match against Left because | |
-- laziness allows that branch to still be valid even if Void is unhabited | |
-- i.e. it could still be populated by bottom values. | |
f :: Either Void Int -> Int |
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 DataKinds #-} | |
{-# LANGUAGE DerivingVia #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE RebindableSyntax #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TypeOperators #-} | |
module IxMonad where |
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
[ | |
{ | |
"backcolor": "#ffffff", | |
"name": "keyboard.io Model 01 - james's layout, based on algernon's Dvorak version", | |
"author": "James Cash <[email protected]>", | |
"switchMount": "alps", | |
"switchBrand": "matias", | |
"switchType": "PG155B01", | |
"pcb": false, | |
"plate": true |
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::BTreeMap; | |
trait ToValue { | |
fn to_value(self) -> Value; | |
} | |
impl ToValue for bool { | |
fn to_value(self) -> Value { | |
Value::Bool(self) | |
} |
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 futures::{stream::FuturesUnordered, StreamExt}; | |
async fn do_something(i: u8) -> String { | |
format! {"Future {i:#b}"} | |
} | |
#[tokio::main] | |
async fn main() { | |
let v = std::sync::Arc::new(tokio::sync::Mutex::new(vec![])); | |
(0..100) |
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
//! https://doc.rust-lang.org/std/panic/fn.catch_unwind.html | |
use std::panic::UnwindSafe; | |
use rand::random; | |
struct Boxed<'a, T> { | |
inner: &'a mut [T], | |
} | |
impl<'a, T> UnwindSafe for Boxed<'a, 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
use std::error::Error; | |
struct WindowsMut<'t, T> { | |
slice: &'t mut [T], | |
start: usize, | |
window_size: usize, | |
} | |
trait LendingIterator { | |
type Item<'a> |
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::{ | |
error::Error, | |
fs::File, | |
io::{self, BufRead}, | |
}; | |
use clap::{ArgGroup, Parser}; | |
#[derive(Parser, Debug)] | |
#[command(author, version, about, long_about = None)] |
NewerOlder