Skip to content

Instantly share code, notes, and snippets.

View tmathmeyer's full-sized avatar
🤧
Achoo

Ted tmathmeyer

🤧
Achoo
  • Google
  • kirkland
View GitHub Profile
// See formulae and constants here:
// https://www.teos-10.org/pubs/Wagner_and_Pruss_2002.pdf
function f2k(f) {
return (f - 32) * 5 / 9 + 273.15;
}
var specific_gas_constant = 461.5; // J/(kg * K)
var critical_pressure = 22.064; // MPa
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:
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={}'
@tmathmeyer
tmathmeyer / infotrimps.js
Last active October 19, 2017 10:23
show ratios on trimps buildings
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
}
#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
#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
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;
}
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;
}
}
@tmathmeyer
tmathmeyer / gist:5718454
Created June 6, 2013 00:32
arduino oscope
import processing.serial.*;
Serial port; // Create object from Serial class
int val; // Data received from the serial port
int[] values;
void setup()
{
size(640, 480);
// Open the port that the board is connected to and use the same speed (9600 bps)
super + {_,shift + }{1-9,0}
bspc {desktop -f,node -d} '^{1-9,10}'