{
/* Where the box is placed */
position: ;
z-index: ;
float: ;
place-self: ;
justify-self: ;
align-self: ;
vertical-align: ;
// No TypeScript | |
function add(a, b) { | |
return a + b; | |
} | |
// Type function arguments | |
// vvvvvv vvvvvv | |
function add(a: number, b: number) { | |
return a + b; | |
} |
const CODES = ['o', 'W', 'X', 'H', 'i', 'a', 'l', 's', 's','Q', 'v', 'y']; | |
console.log(`/${CODES.filter((c,i) => i % 3 == 0).join('')}`) |
ffmpeg -i input.mp4 -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -level 3 -an -vf "scale=-1:1440, reverse" -preset veryslow -g 2 output.mp4 | |
// -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -level 3 | |
// Encode for web with a good balance of browser compatibility and compression ratio | |
// -an | |
// Strip audio tracks | |
// -vf "scale=-1:1440, reverse" | |
// Scale video to 1440px wide, maintaining aspect ratio |
If you have experience with animation in other media, CSS animation’s percentage-based keyframe syntax can feel pretty alien, especially if you want to be very precise about timing. This Sass function lets you forget about percentages and express keyframes in terms of actual frames:
@function f($frame) {
@return percentage( $frame / $totalframes )
}
Javascript files from the examples folder (such as OrbitControls) are not CommonJS or ES Modules, but they can still be used in Webpack bundles:
In package.json
:
"dependencies": {
"three": "0.84.0",
"webpack": "2.4.1"
}
Kyle Simpson (@getify) wrote a very thoughtful post decrying optimize-js, which is a tool I wrote that exploits known optimizations in JavaScript engines to make JS bundles parse faster (especially minified bundles, due to what could be reasonably described as a bug in Uglify).
Kyle lays out a good case, but I tend to disagree with nearly all his points. So here's my rebuttal.
` | |
this allows you to use all of webpack's goodness to load your sprites. | |
here's some benefits: | |
- saving one roundtrip since webpack's json-loader will inline the json data into the script. Thus it doesn't need to be loaded from the server first | |
- use a lot of the file-loader power and beyond to create cache-busting urls, and apply image-minification via e.g. image-webpack-loader | |
` | |
import PIXI from "pixi.js"; |
Below is the list of modern JS frameworks and almost frameworks – React, Vue, Angular, Ember and others.
All files were downloaded from https://cdnjs.com and named accordingly.
Output from ls
command is stripped out (irrelevant stuff)
$ ls -lhS
566K Jan 4 22:03 angular2.min.js