run node schema.js
this will create output.sql
you will need to massage a few things:
- there are duplicate tables like rsv_address and rsv_revenue_and_balances
- address needs to be named to two separate things
def write_to_clipboard(output): | |
import subprocess | |
process = subprocess.Popen('pbcopy', env={'LANG': 'en_US.UTF-8'}, stdin=subprocess.PIPE) | |
process.communicate(output.encode()) |
Algorithms notes
for queues, you dequeue from 0 and enqueue at -1
const fs = require("fs"); | |
const getTimerTemplate = (platform, importType, interval) => ` | |
[Unit] | |
Description=Run ${platform}-${importType} every 15 minutes | |
Requires=${platform}-${importType}.service | |
[Timer] | |
Unit=${platform}-${importType}.service | |
OnUnitInactiveSec=${interval} |
/** | |
* Darkens or lightens a CSS RGB color. Derived from http://www.sitekickr.com/coda/jquery/darken-background-color-element.html | |
* @param {string} rgb "rgb(26,26,26)"" | |
* @param {string} type "darken" or "lighten" | |
* @param {int} percent | |
* @return {string} returns the altered RGB color | |
*/ | |
function alterColor(rgb, type, percent) { | |
rgb = rgb.replace('rgb(', '').replace(')', '').split(','); |
function curry(func, ...argv) { | |
let prevArgs = argv; | |
function innerCurry(...args) { | |
prevArgs.push(...args) | |
if (prevArgs.length === func.length) { | |
return func(...prevArgs); | |
} | |
Support CORS. Allow the API to be accessed through webapps without having to setup a proxy server in between.
Add documentation! Sneaking around the API and looking at the the trip planner code is not optimal.
Build an API the right way. Provide API keys so you can throttle requests and make sure things aren't getting slow.
More frequent polling of the bus locations. Right now it takes 30-90 seconds for bus locations to update. This sucks for users.
When will the 803 info be added to the GTFS database?
const StatsD = require("hot-shots"); | |
const statsdclient = new StatsD(); | |
const properties = Object.getOwnPropertyNames( | |
Object.getPrototypeOf(statsdclient) | |
); | |
const client = properties.reduce((prev, property) => { | |
if (property === "constructor") { |
Some steps I'm taking to debug bad performance with reselect.
My performance problems are coming from the fact that I am not using reselect properly. I wrote a bunch of selectors that use props but don't do anything to make sure they can be shared across multiple components.
The fix for this is: https://github.com/reactjs/reselect/blob/fec65b63b9a2ffa570348271138d20cf831e0185/README.md#sharing-selectors-with-props-across-multiple-components.
But before rewriting tons of code, I'd like to see which selectors are recomputed the most.