Skip to content

Instantly share code, notes, and snippets.

View GasparVardanyan's full-sized avatar
💭
btw I use Arch ... 😄

Gaspar Vardanyan GasparVardanyan

💭
btw I use Arch ... 😄
View GitHub Profile
#include <cctype>
#include <ctime>
#include <stdexcept>
#include <vector>
#include <string>
std::vector<std::string> split(const std::string &s, char delimiter) {
std::vector <std::string> tokens;
# if 0 // stringstream is too much heavy for basic tokenization
std::string token;
// ==UserScript==
// @name ytlocal
// @version 1.0
// @description ytlocal
// @match *://*.youtube.com/watch?*
// @grant none
// @run-at document-end
// ==/UserScript==
# include <concepts>
# include <cstddef>
# include <iostream>
# include <memory>
# include <new>
# include <type_traits>
# include <utility>
# include <vector>
@GasparVardanyan
GasparVardanyan / awcc_fanctrl.conf
Created June 17, 2025 16:22
awcc fan controller
[CPU]
0-39=0
40-44=10
45-49=20
50-54=30
55-59=40
60-64=50
65-69=60
70-74=70
75-79=80
#!/usr/bin/env bash
cmd_list="$1"
arg_list=${@:2}
mkdir -p build
proj=$(basename "$(pwd)")
status=0
# include <stdio.h>
# include <inttypes.h>
uint_least16_t binrev (uint_least16_t n)
{
uint_least16_t r = 0;
while (n)
{
r <<= 1;
r |= n & 1;
@GasparVardanyan
GasparVardanyan / gist:2810deb19a602d45f328b3e48609a750
Created May 15, 2023 14:16
hugo embedded base64 thumbnails
{{ $thumb_base64 := readFile (printf "%s%s" "/public" (.Fill "150x115 q100").RelPermalink) | base64Encode }}
<img src="data:image;base64,{{ $thumb_base64 }}" />
#!/bin/sh
OPFILE=$2
OPMIC_NAME=opusmic
OPMIC_FILE=/tmp/opusmic
OPMIC_RAW=/tmp/opusmic.raw
mkdir -p ~/.config/pulse
OPMIC_CONF=~/.config/pulse/client.conf
template <typename T>
auto popcount8R (const T & val) -> int
{
static_assert (std::is_integral <T> :: value && ! std::is_signed <T> :: value);
if (val == 0)
return 0;
const unsigned char m1 = 0b01010101;
const unsigned char m2 = 0b00110011;
interesting dwm patches to look:
https://dwm.suckless.org/patches/cropwindows/
https://dwm.suckless.org/patches/dynamicswallow/
https://dwm.suckless.org/patches/keychain/
https://dwm.suckless.org/patches/reorganizetags/
https://dwm.suckless.org/patches/status2d/
interesting st patches to look:
https://st.suckless.org/patches/background_image/
https://st.suckless.org/patches/sync/
https://st.suckless.org/patches/undercurl/