Skip to content

Instantly share code, notes, and snippets.

View louh's full-sized avatar
🏖️
Sipping jippers on a beach somewhere

Lou Huang louh

🏖️
Sipping jippers on a beach somewhere
View GitHub Profile
@louh
louh / index.js
Last active March 23, 2020 18:39
AWS Lambda saveWeekenderDataToS3()
const AWS = require('aws-sdk');
const http = require('http');
const BUCKET_ID = 'weekender-data';
const FILES = {
'weekendstatus.js': 'http://web.mta.info/status/weekendstatus.js',
'weekendroutestatus.js': 'http://web.mta.info/status/weekendroutestatus.js',
'weekendboroughstatus.js': 'http://web.mta.info/status/weekendboroughstatus.js',
'LinesStaticData.js': 'http://web.mta.info/weekender/Data/LinesStaticData.js'
};
@louh
louh / STREAMING_NOTES.md
Last active February 6, 2018 23:38
Streaming notes

VSCode

  • Hide menu bar
  • Theme: Abyss
  • Turn on bash pane
  • Adjust user settingsa
    • 2 space tabs
    • Show whitespace
    • Font size should be: ?
  • Extensions
@louh
louh / index.html
Last active February 22, 2017 19:58
A `global.sdk_mapzen_api_key` set inside a scene file will be deleted by Mapzen.js
<!DOCTYPE html>
<html lang="en">
<head>
<title>My Web Map</title>
<meta charset="utf-8">
<link rel="stylesheet" href="https://mapzen.com/js/mapzen.css" />
<script src="https://mapzen.com/js/mapzen.min.js"></script>
<style>
html, body { margin: 0; padding: 0; }
#map { height: 100%; width: 100%; position: absolute; }

Keybase proof

I hereby claim:

  • I am louh on github.
  • I am louh (https://keybase.io/louh) on keybase.
  • I have a public key whose fingerprint is 25F4 0B46 B8F0 6868 8444 9227 93B1 FD11 1775 1812

To claim this, I am signing this object:

@louh
louh / v2.js
Last active July 8, 2017 04:50
SendGrid's new client library is way worse.
var sendgrid = require('sendgrid')(process.env.SENDGRID_USERNAME, process.env.SENDGRID_PASSWORD)
sendgrid.send({
to: 'test@example.com',
from: 'test@example.com',
subject: 'Hello World from the SendGrid Node.js Library',
text: 'some text here'
}, function (err, json) {
if (err) {
res.status(500).json({ msg: 'Could not send feedback.' })
@louh
louh / README.md
Created April 20, 2016 23:44
jscs 3.0.x bug, see issue 2219
.node_modules/.bin/jscs test1.js

Result:

TypeError: Cannot read property 'replace' of undefined
    at renderLine (/Users/lou/Repositories/louh/jscs-test/node_modules/jscs/lib/errors.js:266:16)
    at Object.Errors.explainError (/Users/lou/Repositories/louh/jscs-test/node_modules/jscs/lib/errors.js:197:13)
    at /Users/lou/Repositories/louh/jscs-test/node_modules/jscs/lib/reporters/console.js:16:36
@louh
louh / scene.yaml
Created April 8, 2016 22:09 — forked from anonymous/scene.yaml
[This is a Tangram scene, made with Tangram Play.]
# Author @patriciogv - 2015
cameras:
camera1:
type: isometric
lights:
light1:
type: directional
direction: [0.047,0.974,-0.222]
@louh
louh / mapzen.styleguide_boilerPlate.htm
Last active January 18, 2016 17:14
minimum viable html
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv='x-ua-compatible' content='ie=edge'>
<title>[YOUR PAGE TITLE] · Mapzen</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<!-- If you have other meta tags for social sharing, SEO, etc, add it here -->
<link rel='stylesheet' href='https://mapzen.com/common/styleguide/styles/styleguide.css'>
<!-- If you have other external stylesheets to reference, add it here -->
@louh
louh / gist:b192e3f2258d299b55e0
Created August 23, 2015 03:30
A wonderful paragraph generalizable to "technology for X"
https://blog.ethereum.org/2015/04/13/visions-part-1-the-value-of-blockchain-technology/
Hence, there is substantial hope for a future that can be, to a substantial degree, more decentralized; however, the days of easy gains are over. Now is the time for a much harder, and longer, slog of looking into the real world, and seeing how the technologies that we have built can actually benefit the world. During this stage, we will likely discover that at some point we will hit an inflection point, where most instances of “blockchain for X” will be made not by blockchain enthusiasts looking for something useful to do, coming upon X, and trying to do it, but rather by X enthusiasts who look at blockchains and realize that they are a fairly useful tool for doing some part of X. Whether X is internet of things, financial infrastructure for the developing world, bottom-up social, cultural and economic institutions, better data aggregation and protection for healthcare, or simply controversial charities and uncensorable m
@louh
louh / lrm-valhalla-simple.html
Last active August 29, 2015 14:26
Minimum viable implementation of LRM-Valhalla
<!DOCTYPE html>
<html>
<head>
<title>Simple Valhalla-backed Leaflet Routing Machine</title>
<link rel='stylesheet' href='//cdn.leafletjs.com/leaflet-0.7.3/leaflet.css'>
<link rel='stylesheet' href='./node_modules/lrm-valhalla/examples/leaflet.routing.valhalla.css'>
<script src='//cdn.leafletjs.com/leaflet-0.7.3/leaflet.js'></script>
<script src='./node_modules/leaflet-routing-machine/dist/leaflet-routing-machine.js'></script>
<script src='./node_modules/lrm-valhalla/dist/lrm-valhalla.js'></script>
<style>