Skip to content

Instantly share code, notes, and snippets.

@tevino
tevino / cVimrc
Last active November 10, 2015 14:12
cVimrc
" blacklists prefixed by '@' act as a whitelist
let blacklists = ["https://mail.google.com/*", "*://mail.google.com/*", "*://inbox.google.com/*", "@https://mail.google.com/mail/*"]
@tevino
tevino / copy.go
Created November 30, 2015 02:29
test of io.Copy
package main
import (
"fmt"
"io"
"net"
)
var addrSrv, _ = net.ResolveTCPAddr("tcp", "localhost:2000")
var addrClt, _ = net.ResolveTCPAddr("tcp", "localhost:2001")
@tevino
tevino / lircd.conf
Created January 10, 2013 09:22
lircd.conf for supplied remote control of Mele A1000/A2000/A100 /etc/lirc/lircd.conf
# generated by devinput.sh
begin remote
name devinput
bits 16
eps 30
aeps 100
pre_data_bits 16
pre_data 0x0001
post_data_bits 32
post_data 0x00000001
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import time
import random
import logging
from collections import Counter, defaultdict
from redis import StrictRedis
import gevent
from gevent.pool import Pool
@tevino
tevino / vpn_auto_reconnect
Created June 26, 2015 11:17
A script for automatically reconnecting VPN on OS X after connection dropped
#!/usr/bin/env python
import re
from time import sleep
from subprocess import check_output as run
last_print = None
def printf(s, no_repeat=False):
global last_print
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
int main(){
int fds[2];
int ret;
ssize_t size;
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import HTMLParser
from json import loads
from urllib2 import urlopen
from urllib import urlretrieve
from threading import Thread
@tevino
tevino / time-capsule
Last active April 12, 2018 09:59
time-capsule install; time-capsule monitor
#!/bin/bash
set -o posix
TC=$0
GLOBAL_EXCLUDES="\.git"
alert() {
msg=$1
@tevino
tevino / go-testing-cover-profile-filter.js
Last active May 9, 2018 08:44
Add a search input for go testing cover profile.
// ==UserScript==
// @name Go testing cover profile filter
// @namespace https://github.com/tevino
// @version 0.1
// @description Add a search input for go testing cover profile.
// @author Tevin Zhang
// @grant none
// @require https://code.jquery.com/jquery-2.2.4.min.js
// ==/UserScript==
var frame = null;
@tevino
tevino / pico8.txt
Created May 27, 2018 11:43 — forked from paniq/pico8.txt
PICO-8 hacks & secrets
Screen resolutions
------------------
PICO-8 supports different undocumented videomodes that can be activated at runtime,
using poke(0x5F2C, X) where X is one of the following mode numbers:
0: 128x128, 0 pages
1: 64x128, 1 page
2: 128x64, 1 page
3: 64x64, 3 pages