Skip to content

Instantly share code, notes, and snippets.

View Collar.c
#include <Ethernet.h>
#define rfTransmitPin 4
#define timeDelay 105
#define BEEP 0
#define VIBRATE 1
#define SHOCK 2
/* RF stuff */
#define LONG_PULSE 1260
#define SHORT_PULSE 315
View Pass
Blend[_SrcBlend][_DstBlend]
BlendOp [_BlendOp]
Cull [_CullMode]
ZWrite [_ZWrite]
Stencil {
Ref [_Ref]
ReadMask [_ReadMask]
WriteMask [_WriteMask]
Comp [_Comp]
View To Build:
bazel build @com_github_tommyulfsparre_aurora_exporter//:com_github_tommyulfsparre_aurora_exporter
View BUILD
load("@io_bazel_rules_go//go:def.bzl", "go_prefix")
go_prefix("myThing") # No idea what this string should be. Probably matters *shrug*
View gist:8d0ac3dea43a4ac047d6172cac878594
from collections import defaultdict
def tree():
return defaultdict(tree)
def getAndInsert(value, tree):
# Adds a value to the tree, returns how much of the input collided
collisionLength = 0
cur = tree
for v in value:
if v in cur:
@theepicsnail
theepicsnail / Main.ino
Created Mar 22, 2017
Send RF signals via web server
View Main.ino
#include <SPI.h>
#include <Ethernet.h>
#include <RCSwitch.h>
// Switch settings
typedef struct Config{
String name;
long code[2];
};
Config outlets [5] = {
View .tmux.conf
# Agressive resize
setw -g aggressive-resize on
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using | and -
bind | split-window -h
@theepicsnail
theepicsnail / Snake.java
Created Jun 2, 2016
Found in an email attachment from 2006.
View Snake.java
import java.applet.AudioClip;
import java.awt.Color;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
View gist:50c3e907baa3abf1ff3a013f32ace8ff
data =[
'Row: 1',
'Row: 1 Seat: 2',
'Row: 1 2 3 stuff blah Seat: Something else lalala ']
>>> [re.match("^Row: (.*?)(Seat: .*)?$", line).groups() for line in data]
[('1', None), ('1 ', 'Seat: 2'), ('1 2 3 stuff blah ', 'Seat: Something else lalala ')]
@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