This is a test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Various ways that I have called ffmpeg in the past | |
exec( | |
`ffmpeg -y \ | |
-framerate 60 \ | |
-pattern_type glob \ | |
-i "${framesDirectory}/*.png" \ | |
-crf 27 \ | |
-pix_fmt yuv420p \ | |
-filter:v scale=1000:-1 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grep --no-messages --exclude=".zsh_history" "bloomberg" .* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function radiansToDegrees(radians) { | |
return (radians * 180) / Math.PI; | |
} | |
function degreesToRadians(degrees) { | |
return degrees * (Math.PI / 180); | |
} | |
function proj4toD3(proj4String) { | |
const proj4 = require("proj4"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetch = require("node-fetch"); | |
const jszip = require("jszip"); | |
const shapefile = require("shapefile"); | |
async function fetchGeoJSON(endpoint) { | |
console.log(`🐞 Endpoint: ${endpoint}`); | |
console.log(`🐞 Fetching..`); | |
const res = await fetch(endpoint); | |
const buffer = await res.buffer(); | |
console.log(`🐞 Un-zipping...`); |
Voronoi diagrams are often used to highlight nearby points based on mouse position.
However, the Voronoi will not always work as intended when working with paths.
Try hovering over the middle of the red path — although the mouse is closer to the red path, the blue line is highlighted.
We can fix this problem by sampling points along the path (similar to the technique used here), and adding these sampled points to the Voronoi mesh.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const request = require('request'); | |
const jws = require('jws'); | |
const OAUTH_TOKEN_URI = 'https://www.googleapis.com/oauth2/v4/token'; | |
const APP_HOST = process.env.APP_HOST; | |
const APP_URI = `https://${APP_HOST}`; | |
const creds = require('./service_account'); | |
var iat = Math.floor(new Date().getTime() / 1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Stream<T> { | |
constructor(private start: Start<T>) {} | |
listen(next: Listener<T>) { this.start(next) } | |
} | |
class Stream<T> { | |
constructor(private start: Start<T>) {} | |
compose<U>(fn: (stream: Stream<T>) => Stream<U>): Stream<U> { | |
return fn(this); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2.1' | |
services: | |
node: | |
build: . | |
env_file: .env | |
working_dir: /usr/src/app | |
volumes: | |
- ./:/usr/src/app | |
depends_on: | |
- mongo |
NewerOlder