Skip to content

Instantly share code, notes, and snippets.

View yyolk's full-sized avatar
🍯
𝙧𝙚𝙘𝙪𝙧𝙨𝙞𝙫𝙚 𝙩𝙖𝙪𝙩𝙤𝙡𝙤𝙜𝙮

Joseph Chiocchi yyolk

🍯
𝙧𝙚𝙘𝙪𝙧𝙨𝙞𝙫𝙚 𝙩𝙖𝙪𝙩𝙤𝙡𝙤𝙜𝙮
View GitHub Profile
@yyolk
yyolk / irssi twitch.txt
Last active January 26, 2023 04:57 — forked from lambdan/irssi twitch.txt
Twitch chat with irssi - June 2021
Tested working 20 Jun 2021, irssi version 1.2.3
This is a TLDR version of https://blog.crunchprank.net/connecting-to-twitch-chat-via-irssi/
Get your OAuth token (password) here: https://twitchapps.com/tmi/
# Network setup:
/network add -nick YOUR_TWITCH_USERNAME twitch
/server add -auto -ssl -network Twitch irc.chat.twitch.tv 6697 YOUR_OAUTH_TOKEN
@yyolk
yyolk / snp
Created April 28, 2021 00:33 — forked from erikw/snp
snp: Wrap shell command in BTRFS snapper pre-post snapshots and log outputs.
#!/usr/bin/env bash
# Runs a command wrapped in btrfs snapper pre-post snapshots.
# Usage: $ snp <commands>
# e.g.: $ snp pacman -Syyu
# The latest version of this script is hosted at https://gist.github.com/erikw/5229436
log_path="/var/local/log/snp"
date=$(date "+%Y-%m-%d-%H%M%S")
log_file="${log_path}/snp_${date}.log"
@yyolk
yyolk / Exclude_tables.md
Last active August 18, 2020 16:56 — forked from utek/Exclude_tables.md
Define ignored tables in alembic.ini

Add this in your ini file:

[alembic:exclude]
tables = spatial_ref_sys

In env.py:

@yyolk
yyolk / goog.sh
Created February 9, 2020 22:42
a bash cli for googling things from the cli using, can be easily ported elsewhere source and then `goog something i'm looking for`
# modified from https://stackoverflow.com/a/10660730
rawurlencode() {
local string="${1}"
local strlen=${#string}
local encoded=""
local pos c o
for (( pos=0 ; pos<strlen ; pos++ )); do
c=${string:$pos:1}
case "$c" in
@yyolk
yyolk / nm_l2tp_ipsec_vpn.md
Created February 9, 2020 22:13 — forked from luvarqpp/nm_l2tp_ipsec_vpn.md
setup L2TP IPSEC VPN in archlinux using NetworkManager

setup L2TP IPsec VPN in archlinux using NetworkManager

install networkmanager-l2tp first:

yaourt -S networkmanager-l2tp
apt install -y network-manager-l2tp
@yyolk
yyolk / random-psw.py
Created February 12, 2019 18:54
generates a random psw of 8-16 of length
import string
MIN_LEN, MAX_LEN = 8, 16
from random import randint, choice
characters = string.ascii_letters + string.punctuation + string.digits
password = lambda : "".join(choice(characters) for x in range(randint(MIN_LEN, MAX_LEN)))
print(password())
class Base():
def __init__(self, *a, **k):
exec( "self.{} = self._op".format(
kw.get('override_fn_name',
self.__class__.__name__.lower())))
def _op(self, *a, **k):
pass
@yyolk
yyolk / seeyouspacecowboy.sh
Created August 6, 2018 04:49
A shell script to display SEE YOU SPACE COWBOY whenever you logout of your terminal!
#!/usr/bin/env bash
# SEE YOU SPACE COWBOY by DANIEL REHN (danielrehn.com)
# Displays a timeless message in your terminal with cosmic color effects
# Usage: add "sh ~/seeyouspacecowboy.sh; sleep 2" to .bash_logout (or similar) in your home directory
# (adjust the sleep variable to display the message for more seconds)
# Cosmic color sequence
@yyolk
yyolk / CapsLockCtrlEscape.ahk
Created August 5, 2018 22:37 — forked from sedm0784/CapsLockCtrlEscape.ahk
AutoHotkey script to map Caps Lock to Escape when it's pressed on its own and Ctrl when used in combination with another key, à la Steve Losh. Adapted from one that does something similar with the Ctrl Key on the Vim Tips Wiki (http://vim.wikia.com/wiki/Map_caps_lock_to_escape_in_Windows?oldid=32281). (Plus contribs from @randy909 & @mmikeww.)
g_LastCtrlKeyDownTime := 0
g_AbortSendEsc := false
g_ControlRepeatDetected := false
*CapsLock::
if (g_ControlRepeatDetected)
{
return
}
@yyolk
yyolk / Threadsafe_iter.py
Created August 4, 2018 01:15 — forked from platdrag/Threadsafe_iter.py
An example generic wrapper for making any iterator / generator thread-safe compatible with python 3
import threading
'''
A generic iterator and generator that takes any iterator and wrap it to make it thread safe.
This method was introducted by Anand Chitipothu in http://anandology.com/blog/using-iterators-and-generators/
but was not compatible with python 3. This modified version is now compatible and works both in python 2.8 and 3.0
'''
class threadsafe_iter:
"""Takes an iterator/generator and makes it thread-safe by
serializing call to the `next` method of given iterator/generator.
"""