Skip to content

Instantly share code, notes, and snippets.

Avatar
Consuming coffee

Tim Visée timvisee

Consuming coffee
View GitHub Profile
@timvisee
timvisee / Cargo.toml
Last active December 6, 2022 15:58
AoC 2022 day06b extra p{1..94}
View Cargo.toml
[package]
name = "day06b"
version = "0.1.0"
authors = ["Tim Visee <3a4fb3964f@sinenomine.email>"]
edition = "2021"
[dependencies]
rayon = "1.6"
[profile.release]
@timvisee
timvisee / Cargo.toml
Last active December 6, 2022 15:11
AoC 2022 day06b extra p94
View Cargo.toml
[package]
name = "day06b"
version = "0.1.0"
authors = ["Tim Visee <3a4fb3964f@sinenomine.email>"]
edition = "2021"
[profile.release]
codegen-units = 1
lto = true
strip = true
@timvisee
timvisee / apbf-pin.sh
Created June 16, 2021 14:29
https://github.com/timvisee/apbf for 4 or 5 digit PIN ending with 7
View apbf-pin.sh
#!/bin/bash
# Loop through all 4 and 5 digit combinations
for pin in $(seq -f "%04g" 0 99999)
do
# Skip all pins not ending with 7
[[ $pin == *7 ]] || continue
# Test code
echo "Testing: $pin"
View day05a.rs
pub fn main() {
println!(
"{}",
// Read puzzle input
include_bytes!("../input.txt")
// For each line (each 10 character sequence, and a newline)
.chunks(11)
// Process the 10 character sequence, ignore the newline
.map(|b| b[..10]
.iter()
View x11_clip_and_revert.rs
/// Copy with timeout on X11.
///
/// Keeps clipboard contents in clipboard even if application quits. Doesn't fuck with other
/// clipboard contents and reverts back to previous contents once a timeout is reached.
///
/// Forks & detaches two processes to set/keep clipboard contents and to drive the timeout.
///
/// Based on: https://docs.rs/copypasta-ext/0.3.2/copypasta_ext/x11_fork/index.html
fn copy_timeout_x11(data: &[u8], timeout: u64) -> Result<()> {
use copypasta_ext::{
@timvisee
timvisee / my-subreddits.txt
Last active December 30, 2021 20:24
My subreddits
View my-subreddits.txt
11foot8
18650masterrace
1911
2b2t
3Dprinting
3dshacks
3kliksphilip
45thworldproblems
5September2020
9CB9D65
View barbapappa-routes.txt
$ ./artisan route:list
+--------+----------------------------------------+------------------------------------------------------------------------------------------------------+-----------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
| Domain | Method | URI | Name | Action | Middleware |
+--------+----------------------------------------+------------------------------------------------------------------------------------------------------+-----------------------------------------------------+----
View snippet-correctly-capitalize-names-in-php.md
@timvisee
timvisee / .vimrc
Created June 28, 2019 14:29
Greatly reduced vimrc base for @eloydegen
View .vimrc
""" Configure vim-plug
set nocompatible
filetype off
" Begin vim-plug plugin loading
call plug#begin('~/.local/share/nvim/plugged')
" Jumping
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
View ffsend_generic_crypto_streams_1.rs
use std::cmp;
use std::io::{self, BufRead, BufReader, Cursor, Error as IoError, Read, Write};
use bytes::{BufMut, BytesMut};
use ece::Aes128GcmEceWebPush;
/// The cryptographic mode for a crypter: encrypt or decrypt.
pub enum CryptMode {
/// Encrypt data while transforming.
Encrypt,