Skip to content

Instantly share code, notes, and snippets.

@TomCorwine
TomCorwine / README.md
Last active November 4, 2024 22:19
A simple way to add Twitch chat as an overlay in OBS without using any third-party crap.
  1. In OBS, select the scene you want. Add a new source by clicking on the +. Select Browser.
  2. Name it something reasonable, such as "Chat" and click "OK". A browser create window will open.
  3. For the URL, enter https://www.twitch.tv/popout/YOUR_USER_NAME/chat, replacing YOUR_USER_NAME with, well, your user name.
  4. Set width and height as desired. I found 800x1400 to be good for a 1920x1080 canvas.
  5. Check "Custom CSS" and copy/paste the text from the twitch-chat.css file into the text box.
  6. Make sure "Refresh browser when scene becomes active" is NOT checked. This will allow you to move away from the scene and go back without chat being cleared out.
  7. For permissions, "No access to OBS" is the best option as no access is needed.
  8. Click "OK". You now have a chat window in your scene. Position it as you like with the mouse.
  9. Crop the top and bottom by holding "Alt" and dragging the top and bottom edges. Alternately, you can right click and select Transform -> Edit Transform....
<?php
die();
?>
@TomCorwine
TomCorwine / extract_transactions.py
Created May 13, 2019 20:05
Python script to extract transactions from a wallet exported from the default Bitcoin (or similar) client. Requires `blockchain` module.
from blockchain import blockexplorer
f = open('walletdump2.txt', 'r')
fk = open('keys.txt', 'a+')
for line in f.readlines():
items = line.split()
addr = items[4]
@TomCorwine
TomCorwine / extract_keys.py
Created May 13, 2019 20:04
Python script to extract private keys of a wallet exported from the default Bitcoin (or similar) client.
f = open('walletdump.txt', 'r')
fk = open('keys.txt', 'a+')
for line in f.readlines():
items = line.split()
print(items[0])
fk.write(items[0] + '\n')
f.close()
@TomCorwine
TomCorwine / aes.py
Created March 26, 2017 21:20
Python AES 128 HMAC Authenticated CBC implementation using PyCrypto. DO NOT USE. Use https://github.com/Legrandin/pycryptodome in GCM mode!
import hmac
import hashlib
import os
from itertools import izip
from Crypto.Cipher import AES
AES_BLOCK_SIZE = 16
AES_KEY_SIZE = 16
SIG_SIZE = hashlib.sha256().digest_size
@TomCorwine
TomCorwine / index.js
Created April 18, 2016 07:05
node.js file for creating a Lambda function for a simple Amazon Echo skill. This example pulls the spoken text from a DynamoDB entry.
'use strict'; // I'm not sure what this does. Copied from Amazon's Reindeer Games tutorial.
/*
This is a simple example of how to make an Alexa skill fetch from DynamoDB.
Create a DynamoDB and name it HelloWorld. Make your primary key name 'item' of type 'number'.
Make a second column and call it 'text'.
Create a new item. Give 'item' a value of 0, and populate 'text' with whatever you want Alexa to say.
@TomCorwine
TomCorwine / .bash_profile
Created February 28, 2016 07:03
Bash Profile
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias ll='ls -lh'
alias pj='python -m json.tool'
alias g='git'
alias ga='git add'
alias gb='git branch'
#! /bin/sh
main() {
root=$1
for i in $(find $root -type d -iname '.Training.Spam'); do
process_maildir $(dirname $i)
done
}
@TomCorwine
TomCorwine / dupe_detect.py
Last active August 29, 2015 13:57
This looks for duplicate keys in my iOS localization files
import sys
file_name = sys.argv[1]
with open(file_name) as file:
content = file.readlines()
keys = []
for line in content:
item = line.split('" = "')
key = item[0]
@TomCorwine
TomCorwine / fizzbuzz.py
Last active December 29, 2015 11:29
Job interview thingy
def main():
for i in range(1, 100):
if 0 == i % 3 and 0 == i % 5:
print 'fizzbuzz'
elif 0 == i % 3:
print 'fizz'
elif 0 == i % 5:
print 'buzz'
else:
print i