Skip to content

Instantly share code, notes, and snippets.

@132ikl
132ikl / regionalIndicator.sh
Created July 3, 2018 04:21
for discord memes, don't use nonalpha characters or you'll break it
read foo
foo2="$(echo $foo | tr '\n' 'Ф')"
for (( i=0; i<${#foo}; i++ )); do
echo -n ":regional_indicator_${foo:$i:1}: "
done | tr 'Ф' '\n' | sed 's/:regional_indicator_ :/ /g' | xclip -i -sel clip
@132ikl
132ikl / aestetic.sh
Last active May 4, 2020 05:25
aestetic text generator
#!/bin/bash
IFS='\n'
INPUT=$(cat)
for line in $INPUT; do
for ((i = 0; i < ${#line}; i++)); do
echo -n "${line:$i:1}"
if [[ "$i" != "${#line}" ]]; then # don't insert extra space at EOL
echo -n " "
@132ikl
132ikl / camera_resolutions.py
Last active September 22, 2019 05:53
Python snippet to get a dict of camera's YUYV available resolutions and corresponding FPS values
import subprocess
import re
sp_out = subprocess.run(
"v4l2-ctl -d /dev/video0 --list-formats-ext".split(), capture_output=True
)
# format and remove newlines/tabs
output = str(sp_out.stdout).replace("\\n", " ").replace("\\t", "")
@132ikl
132ikl / .start.sh
Last active December 14, 2019 00:31
YouTube subscription downloader
#!/usr/bin/env bash
set -e
IFS=$'\n'
for i in $(ls -1); do
echo "Playing $i"
sleep 0.5
mpv "$i"
read -p "Delete video? [Y/n] " yn
case $yn in
@132ikl
132ikl / main.py
Created January 4, 2020 23:15
Passing OpenCV Mats to GStreamer pipeline without VideoWriter
import cv2
import gi
gi.require_version("Gst", "1.0")
from gi.repository import Gst # isort:skip
WIDTH = 320
HEIGHT = 240
FPS = 30
@132ikl
132ikl / double2hex.cpp
Created March 25, 2020 05:54
Minecraft script to move a player's location, without using an external NBT editor
#include <iostream>
#include <cstdio>
int main(int argc, char **argv) {
double a;
std::cin >> a;
union
{
long long i;
double d;
### Keybase proof
I hereby claim:
* I am 132ikl on github.
* I am 132ikl (https://keybase.io/132ikl) on keybase.
* I have a public key ASCFM2qkYwIGt3ygy2FK9I0X-7kYo74Jex6gthZpH02QoQo
To claim this, I am signing this object:
@132ikl
132ikl / README.md
Last active July 28, 2022 09:54
Weenie Hut General Messaging Protocol

What is Weenie Hut General Messaging Protocol (WHGMP)?

WHGMP is a message protocol which uses 2 Discord bots and 9 channels.

(pssst... click here to see a more detailed project, with the main bot in addition to the messaging protocol)

How does it work?

WHGMP uses the read/unread badge* in a channel to represent a bit (unread = 1, read = 0). By using 8 channels, one byte can be stored.

The sender waits for a message from the user, then begins to send messages to the data channels. After storing a single byte, a message is sent to the "clock" channel, letting the receiver know to check the read/unread status. Based off of that, a single byte is constructed. When a null-byte is received, the resulting string is printed.

@132ikl
132ikl / openpgp.md
Created April 7, 2021 16:33
OpenGPG proof