Skip to content

Instantly share code, notes, and snippets.

Avatar
🤧
Achoo

Ted tmathmeyer

🤧
Achoo
View GitHub Profile
View gist:acb8a5888076d1fee3e8554d59c052c0
class TypeTree(object):
def __init__(self, name, *children, append=False):
self._name = name
self._children = children or []
self._append = append
def GetAllTags(self):
result = set([self._name])
for child in self._children:
View datagrabber.py
from collections import namedtuple
from html.parser import HTMLParser
import inspect
import requests
import sqlite3
URL = 'https://blue.kingcounty.com/Assessor/eRealProperty/Detail.aspx?ParcelNbr={}'
View ssr.c
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#ifdef linux
#include <sys/resource.h>
#include <unistd.h>
#endif
View shittysquareroot.c
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <math.h>
#include <windows.h>
#define EXP_HIGH_BIT 0x40000000
#define MANT_HIGH_BIT 0x00400000
#define VALUE_COUNT 100000000
@tmathmeyer
tmathmeyer / infotrimps.js
Last active Oct 19, 2017
show ratios on trimps buildings
View infotrimps.js
oldCanAffordBuilding = canAffordBuilding
newCanAffordBuilding = function(what, take, buildCostString, isEquipment, updatingLabel, forceAmt, autoPerc) {
result = oldCanAffordBuilding(what, take, buildCostString, isEquipment, updatingLabel, forceAmt, autoPerc)
if(typeof(result) === "boolean"){
return result
}
gamething = game['buildings'][what]
if (gamething == null) {
return result
}
View api_builder.js
var uuid_gen = require('node-uuid');
inarr = function(arr, f) {
for(var i=0; i<arr.length; i++) {
if (arr[i] === f) {
return true;
}
}
return false;
}
View redisql.js
var uuid_gen = require('node-uuid');
var redis = require('redis').createClient();
var isotope = require('isotope').create(7088);
inarr = function(arr, f) {
for(var i=0; i<arr.length; i++) {
if (arr[i] === f) {
return true;
}
}
View gist:6d6b43c1d5b66abe9317c294456250d1
super + {_,shift + }{1-9,0}
bspc {desktop -f,node -d} '^{1-9,10}'
View bspwmrc
feh --bg-tile /home/ted/.rwpcd/pine.jpg
BORDER=3
PADDING=0
bspc config right_padding $PADDING
bspc config left_padding $PADDING
bspc config border_width $BORDER
bspc config window_gap -$BORDER
bspc config split_ratio 0.50
View post.js
var qs = require("querystring");
var http = require("http");
http.createServer(function(request, response) {
if (request.method === 'POST' || request.method === 'post') {
withPostData(request, function(error, postData) {
// postData is a JSON object from the http request
console.log(error); // if there are no problems, error is just null
console.log(postData); // if there are errors, postData is null
// do real things with post data