Skip to content

Instantly share code, notes, and snippets.

Avatar

Max Timkovich mtimkovich

View GitHub Profile
@mtimkovich
mtimkovich / dive.sh
Created Mar 6, 2019
Quickly dive into Java directories
View dive.sh
dive() {
start=$PWD
if [ -z "$1" ] || [ ! -d "$1" ]; then
return 1
fi
cd "$1"
while [ true ]; do
@mtimkovich
mtimkovich / gif_animatedtexture.py
Created Feb 28, 2019
Break a GIF into its PNG frames and create a AnimatedTexture .tres for them.
View gif_animatedtexture.py
import argparse
import os
from PIL import Image
parser = argparse.ArgumentParser(
description='Convert GIF into frames and then create '
'AnimatedTexture .tres')
parser.add_argument('gif', help='GIF to process')
args = parser.parse_args()
@mtimkovich
mtimkovich / netplay.js
Last active Oct 8, 2019
fake netplay codes
View netplay.js
const netplay = Array(8).fill().map(() =>
Math.floor(Math.random() * 16).toString(16)
).join('');
console.log(netplay);
View split.py
#!/usr/bin/env python
import fileinput
for line in fileinput.input():
print(line.split())
@mtimkovich
mtimkovich / emojifier.go
Created Oct 11, 2018
Convert your documents to emoji
View emojifier.go
package main
import (
"fmt"
"strings"
"github.com/cespare/argf"
)
var alphamoji = map[rune]string{
@mtimkovich
mtimkovich / netplay.py
Last active Feb 14, 2019
fake netplay codes
View netplay.py
import string
from random import choice
print(''.join(choice(string.hexdigits[:-6]) for _ in range(8)))
@mtimkovich
mtimkovich / cryptomoji.js
Created Sep 27, 2017
Cryptomoji - Encrypt messages as emoji
View cryptomoji.js
var emoji = require('node-emoji')
var emojiList = emoji.search('');
function emojiNum(emoji) {
for (var i = 0; i < emojiList.length; i++) {
if (emojiList[i].key === emoji) {
return i;
}
}
@mtimkovich
mtimkovich / tiltcontrols.py
Last active Sep 11, 2017
Type stuff in Overwatch
View tiltcontrols.py
#!/usr/bin/python
import argparse
from autopy3 import key
parser = argparse.ArgumentParser(description='Type garbage in chat')
parser.add_argument('msg', nargs='+', help='message to type')
args = parser.parse_args()
key.tap(key.K_RETURN)
key.type_string(' '.join(args.msg))
@mtimkovich
mtimkovich / cpps.sh
Created Jun 29, 2017
like go run but for c++
View cpps.sh
cpps() {
exe=/tmp/$(basename $1 .cpp)
g++ -std=c++11 -g -O0 $1 -o $exe || return 1
if [ -z "$2" ]
then
$exe
else
$exe "${@:2}"
@mtimkovich
mtimkovich / HashMap.cpp
Last active Jul 2, 2017
Remaking hash tables
View HashMap.cpp
#include <iostream>
#include <vector>
template <class K, class V>
class HashMap;
template <class K, class V>
class Entry {
K const key;
V value;
You can’t perform that action at this time.