Skip to content

Instantly share code, notes, and snippets.

View shurizzle's full-sized avatar
🤌

shurizzle shurizzle

🤌
  • Vodafone, Internet
View GitHub Profile
@shurizzle
shurizzle / Cargo.toml
Last active October 18, 2024 17:06
Blocking and async
[package]
name = "blocking-async"
version = "0.1.0"
edition = "2021"
[[bin]]
name = "blocking_async"
path = "blocking_async.rs"
[profile.release]
@shurizzle
shurizzle / learnvim.lua
Created August 26, 2023 21:56
Just learn vim
for _, key in ipairs({ "Left", "Right", "Up", "Down", "PageUp", "PageDown", "End", "Home", "Del" }) do
local name = key == "Del" and "Delete" or key
for mode, prefix in pairs({ n = "<cmd>", v = "<cmd><C-u>", i = "<C-o><cmd>" }) do
vim.keymap.set(
mode,
("<" .. key .. ">"),
(prefix .. 'echo "No ' .. name .. ' for you!<CR>"'),
{ silent = true, noremap = false }
)
end
@shurizzle
shurizzle / 6.vim
Last active August 5, 2023 03:04
aoc22
^/\(.\)\%(\1\)\@!\(.\)\%(\1\|\2\)\@!\(.\)\%(\1\|\2\|\3\)\@!<CR>:let @+=col('.')+3<CR>
@shurizzle
shurizzle / install.sh
Last active November 2, 2024 02:21
Services on home server
#!/bin/sh
set -eu
echo 'net.ipv4.conf.all.src_valid_mark = 1' | \
sudo tee '/etc/sysctl.d/10-wireguard.conf' >/dev/null
sudo sysctl net.ipv4.conf.all.src_valid_mark=1
docker run -d \
@shurizzle
shurizzle / config.lua
Created October 23, 2022 13:45
LunarVim js config
--[[
lvim is the global options object
Linters should be
filled in as strings with either
a global executable or a path to
an executable
]]
-- THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT
#!/usr/bin/env bash
set -ex
declare -a TO_DELETE=()
cleanup() {
rm -rf "${TO_DELETE[@]}"
}
$code=@'
[DllImport("user32.dll", EntryPoint = "SystemParametersInfo")]
public static extern bool SystemParametersInfo(uint uiAction, uint uiParam, int[] pvParam, uint fWinIni);
'@
Add-Type $code -name Win32 -NameSpace System
$A = 0,0,0
[System.Win32]::SystemParametersInfo(3,0,$A,2)
$A[2] = 0
[System.Win32]::SystemParametersInfo(4,0,$A,2)
["AFN","ALL","DZD","EUR","AOA","XCD","SAR","ARS","AMD","AWG","AUD","EUR","AZN","BSD","BHD","BDT","BBD","EUR","BZD","XOF","BMD","BTN","INR","BYR","BOB","BOV","Dollaro Statunitense","BAM","BWP","NOK","BRL","BND","BGN","XOF","BIF","CVE","KHR","XAF","CAD","XAF","CLF","CLP","CNY","EUR","COP","COU","KMF","CDF","XAF","KRW","KPW","XOF","CRC","HRK","CUC","CUP","ANG","DKK","XCD","USD","EGP","SVC","USD","AED","ERN","EUR","ETB","RUB","FJD","PHP","EUR","XDR","EUR","XAF","GMD","GEL","EUR","GHS","JMD","JPY","GIP","DJF","JOD","EUR","XCD","DKK","XUA","EUR","USD","GTQ","GBP","EUR","GNF","XAF","XOF","GYD","HTG","USD","HNL","HKD","INR","IDR","IRR","IQD","EUR","ISK","GBP","AUD","EUR","KYD","AUD","NZD","FKP","DKK","USD","SBD","USD","ILS","EUR","GBP","KZT","KES","KGS","AUD","KWD","LAK","LSL","ZAR","EUR","LBP","LRD","LYD","CHF","EUR","MOP","MKD","MGA","MWK","MYR","MVR","XOF","EUR","MAD","EUR","MRO","MUR","EUR","MXN","MXV","USD","MDL","EUR","MNT","EUR","XCD","MZN","MMK","NAD","ZAR","AUD","NPR","NIO","XOF","NGN","NZD","NOK","XPF","NZD
#!/usr/bin/env ruby
require 'uri'
require 'open-uri'
require 'tmpdir'
require 'open3'
module MacOS
module Desktop
BACKGROUND_TEMPLATE = "tell application \"Finder\"\n set myFile to POSIX file %s as string\n set desktop picture to file myFile\nend tell"
#include <stdio.h>
char const * template[] = {
"%i",
"Buzz",
"Fizz",
"FizzBuzz"
};
const int __donotuseme3[] = { 2, 0, 0 };
const int __donotuseme5[] = { 1, 0, 0, 0, 0 };