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
export default { | |
data() { | |
return { | |
debugEnabled: true, | |
debugFrame: null | |
} | |
}, | |
methods: { | |
registerEvents() { | |
this.$el.addEventListener('mouseenter', this.showDebug) |
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 chalk = require('chalk') | |
const terminalLink = require('terminal-link') | |
const log = console.log | |
module.exports = { | |
log, | |
chalk, | |
terminalLink, | |
success: (msg) => log(chalk.green(msg)), |
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
# Split video in chunk of 5 seconds with a crop | |
ffmpeg -i input.mp4 -an -vcodec libx264 -profile:v baseline -level 3 -vf "crop=720:720:600:180" -map 0 -segment_time 00:00:05 -f segment -reset_timestamps 1 output%03d.mp4 | |
# Split video in chunk of 5 seconds | |
ffmpeg -i input.mp4 -an -vcodec libx264 -profile:v baseline -level 3 -map 0 -segment_time 00:00:05 -f segment -reset_timestamps 1 output%03d.mp4 |
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
export default ({ target, listener = false }) => { | |
let observable = null | |
const set = (target, name, value) => { | |
target[name] = value | |
if (listener && typeof listener === 'function') { | |
listener(observable) | |
} | |
return true | |
} |
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
/** | |
* ScrollRAF | |
* Optimize animations on scroll | |
* Simple Singleton to listen scroll and update things on raf | |
*/ | |
class ScrollRAF { | |
constructor () { | |
if (!ScrollRAF.instance) { | |
this._isRunning = false | |
this._callbacksMap = {} |
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
/** | |
* ScrollDirection | |
* Simple Singleton to listen scrollDirection | |
* Use an array of callbacks objects running when user scroll to top or to down | |
* Could be usefull to pin header on scroll top for example | |
*/ | |
class ScrollDirection { | |
constructor () { | |
if (!ScrollDirection.instance) { | |
this._isRunning = false |
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
export const isAutoplaySupported = () => { | |
// Detect if user can autoplay inline video | |
// Works when user is on low-battery mode on IOS | |
// Return promise from video.play | |
const video = document.createElement('video') | |
video.src = 'data:video/mp4;base64,AAAAIGZ0eXBtcDQyAAAAAG1wNDJtcDQxaXNvbWF2YzEAAATKbW9vdgAAAGxtdmhkAAAAANLEP5XSxD+VAAB1MAAAdU4AAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAACFpb2RzAAAAABCAgIAQAE////9//w6AgIAEAAAAAQAABDV0cmFrAAAAXHRraGQAAAAH0sQ/ldLEP5UAAAABAAAAAAAAdU4AAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAoAAAAFoAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAHVOAAAH0gABAAAAAAOtbWRpYQAAACBtZGhkAAAAANLEP5XSxD+VAAB1MAAAdU5VxAAAAAAANmhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABMLVNNQVNIIFZpZGVvIEhhbmRsZXIAAAADT21pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAw9zdGJsAAAAwXN0c2QAAAAAAAAAAQAAALFhdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAoABaABIAAAASAAAAAAAAAABCkFWQyBDb2RpbmcAAAAAAAAAAAAAAAA |
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 RAF { | |
constructor () { | |
if (!RAF.instance) { | |
this._radId = null | |
this._callbacksMap = {} | |
this._callbacks = [] | |
RAF.instance = this | |
} | |
return RAF.instance |
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
echo "Creating an SSH key for you..." | |
ssh-keygen -t rsa | |
echo "Please add this public key to Github \n" | |
echo "https://github.com/account/ssh \n" | |
read -p "Press [Enter] key after this..." | |
echo "Installing xcode-stuff" | |
xcode-select --install |
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
/** | |
* Generate web videos mp4 + webm from given folder | |
* You can pass options by file in videos.json | |
* Options are crop size | |
* NODE and FFMEPG is required. On mac brew install node && brew install ffmpeg | |
* FFMPEG command are inspired by https://gist.github.com/Vestride/278e13915894821e1d6f | |
* eg: node videos.js --input=../inputDir --output=../dir/outputDir --prefix=compressed --r-audio | |
* if missing outputDir, inputDir will be use | |
*/ |
NewerOlder