Skip to content

Instantly share code, notes, and snippets.

import math
import random
import pygame
from pygame.locals import *
pygame.init()
# Overview
# Simulator
# run
# addObject
@theepicsnail
theepicsnail / pass.py
Last active September 17, 2015 05:41
pass server
import BaseHTTPServer
from subprocess import Popen, PIPE
# What interface to listen on
# Don't change this unless you want to leak your passwords.
HOST = '127.0.0.1'
# What port to listen on. Change this if you'd like,
# you'll need to update the chrome extension's port too.
PORT = 9573
server {
listen 80;
server_name ~^(.*).theepicsnail.net;
root /home/snail/public_html/$1/;
charset utf-8;
location / {
autoindex on;
}
}
@theepicsnail
theepicsnail / config
Last active August 29, 2015 14:20
.i3/config
set $mod Mod4
set $alt Mod1
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen
bindsym $mod+F5 exec --no-startup-id i3-msg restart
@theepicsnail
theepicsnail / WeechatOTR.md
Last active April 15, 2025 04:12
Install weechat, and otr for weechat.
sudo apt-get install weechat python-pip python-dev
sudo pip install virtualenv
virtualenv -p `which python2.7` .weechatenv
source .weechatenv/bin/activate
pip install python-potr
alias weechat="source ~/.weechatenv/bin/activate; weechat-curses; deactivate"

in weechat then do

@theepicsnail
theepicsnail / watch.sh
Created January 16, 2015 21:58
Monitor files, rerun script when they are modified
#!/bin/bash
# find --
split="-1"
for (( i = 0; i < ${#@}; i++ )); do
if [ "${!i}" == "--" ]
then
split=$i
i=${#@}
fi
done
@theepicsnail
theepicsnail / flux2.py
Created August 24, 2014 00:20
Flux2 solver
import subprocess
#figure this stuff out automatically?
left,top = 58, 478
right,bottom = 1020, 1440
cell_size = 186
height = (bottom - top)
width = (right - left)
gap = (width % cell_size)/(width/cell_size - 1)
import subprocess
#figure this stuff out automatically?
left,top = 58, 478
right,bottom = 1020, 1440
cell_size = 186
height = (bottom - top)
width = (right - left)
gap = (width % cell_size)/(width/cell_size - 1)
alias watch="bash ~/watch.sh"
# watch foo.js bar.js -- ./runTests.sh
# runs runTests.sh, then waits for foo.js or bar.js to be modiified
# then reruns runTests.sh (kills the old process if it's still alive)
@theepicsnail
theepicsnail / glass.html
Created May 3, 2014 04:57
[wearscript] Speed reader
<html style="width:100%; height:100%; overflow:hidden">
<head>
<!-- You can include external scripts here like so... -->
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>-->
</head>
<body style="width:100%; height:100%; overflow:hidden; margin:0" bgcolor="#000">
<canvas id="canvas" width="640" height="360" style="display:block"></canvas>
<script>
var words_per_minute = 300