Use MSYS2 inside VSCode's terminal
{
"terminal.integrated.shell.windows": "C:\\msys64\\msys2_shell.cmd",
"terminal.integrated.shellArgs.windows": [
"-defterm",
"-no-start",
"-use-full-path",
"-mingw",
// Derived from https://dhariri.com/2023/youtube-sub-download | |
// See link for more information | |
// | |
// Usage | |
// 1. Go to https://www.youtube.com/feed/channels | |
// 2. Scroll to bottom | |
// 3. Run script in dev tools console | |
// 4. Save output to an .opml file | |
let channelList = ytInitialData.contents.twoColumnBrowseResultsRenderer.tabs[0].tabRenderer.content.sectionListRenderer.contents[0].itemSectionRenderer.contents[0].shelfRenderer.content.expandedShelfContentsRenderer.items; |
use rand_core::RngCore; | |
pub struct Key(i64); | |
pub struct Secret(i64); | |
impl Secret { | |
pub fn new<R: RngCore>(rng: &mut R, value: i64) -> (Key, Self) { | |
let key = rng.next_u64() as i64; | |
(Key(key), Self(key.wrapping_add(value))) |
workspace 1a output $left_display | |
workspace 2a output $left_display | |
workspace 3a output $left_display | |
workspace 4a output $left_display | |
workspace 5a output $left_display | |
workspace 6a output $left_display | |
workspace 7a output $left_display | |
workspace 8a output $left_display | |
workspace 9a output $left_display |
use core::slice; | |
use std::io::{stdout, Write}; | |
use std::ptr::null; | |
use x11_dl::xlib; | |
use libvips::{ | |
ops::{pngsave_buffer, BandFormat}, | |
VipsImage, | |
}; |
macro_rules! include_file_as_resp { | |
($file:expr) => {{ | |
use headers::HeaderMapExt; | |
let body = include_bytes!($file).as_slice(); | |
let mut resp = warp::reply::Response::new(body.into()); | |
let mime = mime_guess::from_path($file).first_or_octet_stream(); | |
resp.headers_mut().typed_insert(headers::ContentLength(body.len() as u64)); | |
resp.headers_mut().typed_insert(headers::ContentType::from(mime)); | |
resp.headers_mut().typed_insert(headers::AcceptRanges::bytes()); | |
resp |
// We can use log2(x) = size_of(x) - 1 - clz(x). | |
// And then do a base conversion log_b(x) = log2(x) / log2(b). | |
// Then log_b(x) + 1 is the number of digits in base b for x > 0. | |
fn count_digits(x: usize, base: u8) -> usize { | |
1 + (8 * mem::size_of::<usize>() - 1 - x.leading_zeros() as usize) / (7 - base.leading_zeros() as usize) | |
} | |
// Say we know we're counting in base 10 or base 16. We can calculate the divisor. | |
fn count_base10_digits(x: usize) -> usize { | |
1 + (8 * mem::size_of::<usize>() - 1 - x.leading_zeros() as usize) / 3 |
use std::default::Default; | |
use std::io; | |
use html5ever::tendril::*; | |
use html5ever::tokenizer::BufferQueue; | |
use html5ever::tokenizer::{CharacterTokens, EndTag, NullCharacterToken, StartTag, TagToken, DoctypeToken, CommentToken, EOFToken}; | |
use html5ever::tokenizer::{ParseError, Token, TokenSink, TokenSinkResult, Tokenizer, TokenizerOpts}; | |
use std::io::Write; |
Use MSYS2 inside VSCode's terminal
{
"terminal.integrated.shell.windows": "C:\\msys64\\msys2_shell.cmd",
"terminal.integrated.shellArgs.windows": [
"-defterm",
"-no-start",
"-use-full-path",
"-mingw",
git archive --format=tar.gz -o ~/repos/attic/archives/$(date --date="@$(git log -1 --format=%ct)" +%Y)-$(basename $PWD).tar.gz --prefix=$(basename $PWD)/ master |
I hereby claim:
To claim this, I am signing this object: