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
# convert to h.264 mp4 | |
ffmpeg -i $input -f mp4 -vcodec libx264 -preset fast -profile:v high -level:v 5 $output -hide_banner | |
3 remove audio track only | |
ffmpeg -i $input -vcodec copy -an $output | |
# shrink video resolution | |
ffmpeg -i input.mp4 -vf scale=480:320 output_320.mp4 | |
# change the video resolution and aspect ratio |
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
# Adobe | |
127.0.0.1 activate.adobe.com | |
127.0.0.1 practivate.adobe.com | |
127.0.0.1 ereg.adobe.com | |
127.0.0.1 activate.wip3.adobe.com | |
127.0.0.1 wip3.adobe.com | |
127.0.0.1 3dns-3.adobe.com | |
127.0.0.1 3dns-2.adobe.com | |
127.0.0.1 adobe-dns.adobe.com |
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
/** | |
* Turns a number/string to 2 digits day of the month with leading zero. | |
* @param {number|string} day to turn into day. | |
* @return {string} | |
*/ | |
function numberToDay(j) { | |
return ('0' + j).slice(-2); | |
} | |
// Examples: |
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
/* iPhone X and Xs Max */ | |
@media only screen | |
and (min-device-width: 375px) | |
and (min-device-height: 812px) | |
and (-webkit-device-pixel-ratio: 3) | |
and (orientation: portrait) { | |
/* styles */ | |
} | |
/* iPhone XR */ |
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
curl -i https://git.io -F "url=<original_url>" [-F "code=<token>"] | |
: ' | |
$ curl -i https://git.io -F "url=https://gist.github.com/hoyangtsai/a6f2cddb1de1a25c42e030ab8d9ee559" | |
HTTP/1.1 201 Created | |
Status: 201 Created | |
Content-Type: text/html;charset=utf-8 | |
Location: https://git.io/JSbdz | |
... |
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 {task, src, dest ,watch, series, parallel} = require('gulp'); | |
const rename = require('gulp-rename'); | |
const postcss = require('gulp-postcss'); | |
const prettify = require('gulp-jsbeautifier'); | |
const connect = require('gulp-connect'); | |
const postcssConfig = require('./postcss.config.js'); | |
const cssOutput = './css'; | |
const postcssWatchFiles = ['./pcss/**/[^_]*.pcss', '!node_modules/**']; |
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
fullScreenClass() { | |
const w = window.innerWidth | |
|| document.documentElement.clientWidth | |
|| document.body.clientWidth; | |
const h = window.innerHeight | |
|| document.documentElement.clientHeight | |
|| document.body.clientHeight; | |
const ratio = +(h / w); |
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 jsdoc2md = require('jsdoc-to-markdown') | |
const gulp = require('gulp') | |
const glob = require('glob') | |
const path = require('path') | |
const fs = require('fs-extra') | |
const docDir = './docs' | |
async function doJsdoc2md() { | |
const fileSrc = 'src/**/*.js'; |
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
let charCode = String.prototype.charCodeAt.call(str, index) | |
// char code between 48 and 57 is the number 0 - 9 | |
if ( charCode < 48 || charCode > 57) { | |
... | |
} |
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
# create a directory for the project repo | |
mkdir [project_name] && cd [project_name] | |
# initialize git repo | |
git init | |
# enable git subtree checkout | |
git config core.sparsecheckout true | |
# enter a folder name which is checked out |