Skip to content

Instantly share code, notes, and snippets.

@theepicsnail
theepicsnail / pass.py
Last active Sep 17, 2015
pass server
View pass.py
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
View gist:f3ee120f2bb6274bc141
server {
listen 80;
server_name ~^(.*).theepicsnail.net;
root /home/snail/public_html/$1/;
charset utf-8;
location / {
autoindex on;
}
}
View 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 Feb 5, 2016
Install weechat, and otr for weechat.
View WeechatOTR.md
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 Jan 16, 2015
Monitor files, rerun script when they are modified
View watch.sh
#!/bin/bash
# find --
split="-1"
for (( i = 0; i < ${#@}; i++ )); do
if [ "${!i}" == "--" ]
then
split=$i
i=${#@}
fi
done
View flux2.py
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)
View gist:dc1dcddb0051ab9e5f16
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)
View watch.sh
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
[wearscript] Speed reader
View glass.html
<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
@theepicsnail
theepicsnail / glass.html
Created Apr 29, 2014
[wearscript] Slide show example
View glass.html
<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