Skip to content

Instantly share code, notes, and snippets.

Dmitry Blotsky dblotsky

Block or report user

Report or block dblotsky

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dblotsky
dblotsky / index.html
Created Apr 10, 2018
Sample JS "Redirect"
View index.html
<!DOCTYPE html>
<html>
<head>
<title></title>
<!-- CSS goes in here -->
<style type="text/css">
</style>
</head>
@dblotsky
dblotsky / index.html
Created Jan 15, 2018
Small reproduction of iOS reload bug.
View index.html
<!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 Mar 7, 2017
Thesis Makefile
View 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 Jul 24, 2015
The reasons I hate Gulp.
View gulp_snippet.js
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 Aug 29, 2015
Translate a well-formatted ASCII binary string into readable English.
View english.py
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 Aug 29, 2015
Curses die-roller for Settlers of Catan
View catan.py
#! /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 Aug 29, 2015
Happy Word Search
View word_search.py
# 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 Jan 12, 2013
Apple "say" command saying things in different voices.
View voices.sh
#! /bin/bash
usage() {
echo "Usage: $0 [phrase | \"default\"]"
exit 1
}
run() {
local phrase=$@
You can’t perform that action at this time.