Skip to content

Instantly share code, notes, and snippets.

Avatar
😎
yeah, i do the program

132ikl 132ikl

😎
yeah, i do the program
View GitHub Profile
@132ikl
132ikl / README.md
Last active Nov 3, 2020
Weenie Hut General Messaging Protocol
View README.md

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.

View gist:569af865ca98111a6e34387d2dffae55
### 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 / double2hex.cpp
Created Mar 25, 2020
Minecraft script to move a player's location, without using an external NBT editor
View double2hex.cpp
#include <iostream>
#include <cstdio>
int main(int argc, char **argv) {
double a;
std::cin >> a;
union
{
long long i;
double d;
@132ikl
132ikl / main.py
Created Jan 4, 2020
Passing OpenCV Mats to GStreamer pipeline without VideoWriter
View main.py
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 / .start.sh
Last active Dec 14, 2019
YouTube subscription downloader
View .start.sh
#!/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 / camera_resolutions.py
Last active Sep 22, 2019
Python snippet to get a dict of camera's YUYV available resolutions and corresponding FPS values
View camera_resolutions.py
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 / aestetic.sh
Last active May 4, 2020
aestetic text generator
View aestetic.sh
#!/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 / regionalIndicator.sh
Created Jul 3, 2018
for discord memes, don't use nonalpha characters or you'll break it
View regionalIndicator.sh
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
You can’t perform that action at this time.