Skip to content

Instantly share code, notes, and snippets.

View dblotsky's full-sized avatar

Dmitry Blotsky dblotsky

  • Waterloo, ON
View GitHub Profile
@dblotsky
dblotsky / index.html
Created April 10, 2018 03:26
Sample JS "Redirect"
<!DOCTYPE html>
<html>
<head>
<title></title>
<!-- CSS goes in here -->
<style type="text/css">
</style>
</head>
@dblotsky
dblotsky / index.html
Created January 15, 2018 06:03
Small reproduction of iOS reload bug.
<!DOCTYPE html>
<html>
<head>
<title>Reload Bug</title>
<style type="text/css">
p {
font-size: 3em;
}
</style>
<script type="text/javascript">
@dblotsky
dblotsky / Makefile
Created March 7, 2017 03:15
Thesis Makefile
# config
N = 10
S = 4321
T = 20
PROBLEM_SELECTOR = control
BENCHMARK_SELECTOR = unsat/big
# constants
CSV_HEADER = "problem,elapsed,start,end,command"
@dblotsky
dblotsky / gulp_snippet.js
Created July 24, 2015 07:23
The reasons I hate Gulp.
gulp.task("clean", function () {
return gulp.src("dist/*").pipe(rm());
});
gulp.task("config", function() {
spawn("python", ["gen_config.py"])
.stdout
.pipe(stream("config.yml"))
.pipe(buffer())
.pipe(gulp.dest("."));
@dblotsky
dblotsky / english.py
Last active August 29, 2015 14:13
Translate a well-formatted ASCII binary string into readable English.
binary = '01001001 00100000 01100010 01100101 01101100 01101001 01100101 01110110 01100101 00100000 01101001 01101110 00100000 01111001 01101111 01110101 00100000 00111100 00110011'
english = ''.join(chr(int(c, 2)) for c in binary.split(' '))
@dblotsky
dblotsky / catan.py
Last active August 29, 2015 14:10
Curses die-roller for Settlers of Catan
#! /usr/bin/python
import random
import curses
KEY_ESCAPE = 27
KEY_ENTER = 10
KEY_Q = 81
KEY_q = 113
@dblotsky
dblotsky / word_search.py
Last active August 29, 2015 14:07
Happy Word Search
# the word seach board, as a list of rows
# NOTE:
# rows must all be of the same length
BOARD = [
"wcbqlqhtwgayj",
"bfhtgaycxqqtx",
"vrhczdtgayxfq",
"cvgaykcxwpfhd",
"tbqlqgayltvtg",
"sdwhfxcqjbqla",
@dblotsky
dblotsky / voices.sh
Created January 12, 2013 21:25
Apple "say" command saying things in different voices.
#! /bin/bash
usage() {
echo "Usage: $0 [phrase | \"default\"]"
exit 1
}
run() {
local phrase=$@