Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View mtimkovich's full-sized avatar
🐢

Max Timkovich mtimkovich

🐢
View GitHub Profile
@mtimkovich
mtimkovich / fuzzy_clock.py
Last active January 17, 2017 18:48
fuzzy clock
#!/usr/bin/env python3
from datetime import datetime
word = {
1: 'one',
2: 'two',
3: 'three',
4: 'four',
5: 'five',
6: 'six',
@mtimkovich
mtimkovich / rename.py
Last active December 13, 2016 22:58
Mass rename files with python
#!/usr/bin/env python3
import argparse
from glob import glob
import os
import re
import sys
def parse_args():
parser = argparse.ArgumentParser('Rename files using regex')
@mtimkovich
mtimkovich / mail.py
Last active May 3, 2019 22:19
For Claire. Marks all emails as read.
#!/usr/bin/env python3
from imapclient import IMAPClient, SEEN
auth = {
# Enter your user name and password between the quotes below.
'username': 'USERNAME',
'password': 'PASSWORD',
'host': 'imap.gmail.com',
}
@mtimkovich
mtimkovich / beer-song.scm
Last active November 12, 2016 11:10
You already know
(use format)
(define (beer-song n)
(format #t "~A bottle~:P of beer on the wall.~%" n)
(format #t "~A bottle~:P of beer.~%" n)
(print "Take one down.")
(print "Pass it around.")
(let ((n (- n 1)))
(if (> n 0)
(begin
@mtimkovich
mtimkovich / password.py
Last active January 3, 2017 15:58
Random Password Generator
#!/usr/bin/python3
import random
import string
import argparse
parser = argparse.ArgumentParser(description='Random password generator. Defaults to 8 character passwords composed of alphanumeric characters')
parser.add_argument('passwd_length', type=int, default=8, nargs='?',
help='Length of password. Defaults to 8')
parser.add_argument('-s', '--special', action='store_true',
help='Use special characters')
@mtimkovich
mtimkovich / .vimrc
Last active March 7, 2017 22:14
.vimrc
set nocompatible
syntax on
set background=dark
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
" Plugin 'wincent/command-t'
@mtimkovich
mtimkovich / woodo.py
Last active January 3, 2017 17:36
Although it always pretends to be a tree, its composition appears to be closer to a rock than a plant.
#!/usr/bin/python3
import os
if os.geteuid() != 0:
print("It's a weird tree.")
else:
print(r"""
_ __
/ `\ (~._ ./ )
\__/ __`-_\__/ ./
@mtimkovich
mtimkovich / woodo
Last active August 29, 2015 14:02 — forked from ryanzabcik/woodo
#!/usr/bin/env perl
use strict;
use warnings;
if ($<) {
print "It's a weird tree.\n";
} else {
print <<'EOF';
_ __
/ `\ (~._ ./ )
@mtimkovich
mtimkovich / word_ladder.py
Last active March 23, 2016 17:46
Python code to generate word ladders using A* search. Should find the shortest word path between any two words. The word list I'm using can be found at http://norvig.com/ngrams/TWL06.txt
#!/usr/bin/env python
from heapq import *
import string
import sys
class WordNode:
def __init__(self, word, goal, distance, parent):
self.word = word
self.distance = distance
@mtimkovich
mtimkovich / to_array.pl
Created January 25, 2014 18:57
String to Array
#!/usr/bin/env perl
use strict;
use warnings;
my $string = "array downto function of repeat until begin else goto packed set var case end if procedure then while const file label program to with do for nil record type";
my @reserved = split /\s+/, $string;
my $array = join ",", map { '"'.$_.'"' } @reserved;
$array = "{" . $array . "}";