Skip to content

Instantly share code, notes, and snippets.

View yescallop's full-sized avatar

Scallop Ye yescallop

View GitHub Profile
@yescallop
yescallop / wg-dynconf.ps1
Last active May 24, 2024 08:48
Assigning dynamic IPv6 GUA to WireGuard interface
[CmdletBinding(DefaultParameterSetName = 'Reresolve')]
param (
[Parameter(Mandatory, ParameterSetName = "Stop")]
[switch]$Stop,
[Parameter(Mandatory, ParameterSetName = "Reresolve")]
[Parameter(Mandatory, ParameterSetName = "ReresolveAndAssignV6")]
[string]$Peer,
[Parameter(Mandatory, ParameterSetName = "Reresolve")]
[Parameter(Mandatory, ParameterSetName = "ReresolveAndAssignV6")]
[string]$DnsName,
@yescallop
yescallop / gal.rs
Last active February 4, 2024 06:30
Generic Associated Lifetime
use core::fmt;
pub trait Str {
fn concretize<'a>(self) -> &'a str
where
Self: 'a;
}
impl Str for &str {
fn concretize<'a>(self) -> &'a str
@yescallop
yescallop / connect6.asm
Last active June 2, 2022 08:31
Connect6 implementation (partial) in 8086 assembly.
.8086
.model small
.stack 100h
.data
board_size equ 19
board_len equ (board_size * board_size)
board db (board_len / 2) dup (0), 1, (board_len / 2) dup (0)
stone db 2