Examples here use the default settings, see the VidStab readme on GitHub for more advanced instructions.
Here's an example video I made
brew install ffmpeg --with-libvidstab
function product() { | |
var args = Array.prototype.slice.call(arguments); // makes array from arguments | |
return args.reduce(function tl (accumulator, value) { | |
var tmp = []; | |
accumulator.forEach(function (a0) { | |
value.forEach(function (a1) { | |
tmp.push(a0.concat(a1)); | |
}); | |
}); | |
return tmp; |
Examples here use the default settings, see the VidStab readme on GitHub for more advanced instructions.
Here's an example video I made
brew install ffmpeg --with-libvidstab
#ifdef GL_ES | |
precision highp float; | |
#endif | |
uniform sampler2D to, from; | |
uniform float progress; | |
uniform vec2 resolution; | |
void main() { | |
vec2 p = gl_FragCoord.xy / resolution.xy; | |
vec4 a = texture2D(from, p); //vec4(0.0, 0.0, 0.0, 0.0); |
I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.
I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.
Chrome 51 has some pretty wild behaviour related to console.log
in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.
Many of us building single-page apps today use JavaScript module bundling tools that trend towards a monolithic "bundle.js" file including the full app and vendor code for multiple routes. This means if a user lands on any arbitrary route they need to wait for a large bundle of JS to be fetched, parsed and executed before the application is fully rendered and interactive.
This is a little backwards, especially when apps are used under real-world network (3G) and device
vec2 backgroundUV (vec2 uv, vec2 resolution, vec2 texResolution) { | |
float tAspect = texResolution.x / texResolution.y; | |
float pAspect = resolution.x / resolution.y; | |
float pwidth = resolution.x; | |
float pheight = resolution.y; | |
float width = 0.0; | |
float height = 0.0; | |
if (tAspect > pAspect) { | |
height = pheight; |
#!/usr/bin/env bash | |
# fetch_nike_puls_all_activities.bash | |
# A simple bash script to fetch all activities and metrics from NikePlus. | |
# See `nike_plus_api.md` for the API details. | |
readonly bearer_token="$1" | |
if [[ -z "$bearer_token" ]]; then | |
echo "Usage: $0 bearer_token" | |
exit |
const cloneGltf = (gltf) => { | |
const clone = { | |
animations: gltf.animations, | |
scene: gltf.scene.clone(true) | |
}; | |
const skinnedMeshes = {}; | |
gltf.scene.traverse(node => { | |
if (node.isSkinnedMesh) { |
// @flow | |
import * as React from "react"; | |
import ResizeObserver from "resize-observer-polyfill"; | |
import invariant from "invariant"; | |
type Entry = { | |
+contentRect: { | |
+width: number, | |
+height: number |