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
#!/bin/sh | |
# Based on instructions found here: http://wiki.razuna.com/display/ecp/FFMpeg+Installation+on+CentOS+and+RedHat#FFMpegInstallationonCentOSandRedHat-InstallX264 | |
if [ "`/usr/bin/whoami`" != "root" ]; then | |
echo "You need to execute this script as root." | |
exit 1 | |
fi | |
cat > /etc/yum.repos.d/centos.repo<<EOF |
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
// lazy load helper | |
function lazyComponent(promise: Promise<any>): (nextState: Router.RouterState, callback: (error, component?) => void) => void { | |
return (nextState, callback) => { | |
promise.then( | |
(module) => { | |
setTimeout(() => callback(null, module.default) && router.setLoading(true), 1000) | |
}, | |
(error) => callback(error) | |
); |
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
/* | |
* Easing Functions - inspired from http://gizma.com/easing/ | |
* only considering the t value for the range [0, 1] => [0, 1] | |
*/ | |
EasingFunctions = { | |
// no easing, no acceleration | |
linear: function (t) { return t }, | |
// accelerating from zero velocity | |
easeInQuad: function (t) { return t*t }, | |
// decelerating to zero velocity |
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
# Fix blurry fonts on macos mojave | |
# https://www.reddit.com/r/apple/comments/9ijuft/how_to_fix_blurry_fonts_on_macos_mojave_with/ | |
defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO |
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
// Rectangle diff algorithm | |
// https://en.wikibooks.org/wiki/Algorithm_Implementation/Geometry/Rectangle_difference | |
type Rect = Pick<ClientRect, 'top' | 'left' | 'width' | 'height'>; | |
/** | |
* Checks if the first rectangle contains the second. | |
* | |
* @param rectA first rectangle |