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
.selector { | |
/* Positioning */ | |
position: absolute; | |
z-index: 10; | |
top: 0; | |
right: 0; | |
bottom: 0; | |
left: 0; | |
/* Display & Box Model */ |
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
apt -y install python3-venv python-pip |
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
### Fundamental | |
- Use auto_increment integer as primary key for **all** tables(make its name be `id`) | |
- Comment is required for new columns& new tables | |
- Use `utf8` as the default charset for character type | |
- Single table size < 50 millions records | |
- Do not store images, files as binary type in database | |
- Do not connect **production** database through `ldev`, `dev`, `test` and `sandbox` environment | |
- Do not do **stress test** on production database | |
### Naming convention |
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 AQIURL = 'https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%22http%3A%2F%2Fwww.weather.org.hk%2Fenglish%2Faqi.html%22%20and%20xpath%3D%22%2F%2Ftable%2F%2Ftable%2F%2Ftable%22&format=json&diagnostics=true&callback='; | |
fetch(AQIURL) | |
.then(res => res.json()) | |
.then((json) => { | |
// console.log(json.query.results) | |
console.log(json.query.results.table[0].tbody.tr.td.center.b.replace('Time: ', '')); | |
let result = {}; | |
json.query.results.table[1].tbody.tr.slice(2).forEach((element) => { | |
result[element.td[0]] = { | |
NO2: element.td[1].font.content, |
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
# Resizing video to fit App preview requirement | |
ffmpeg -i input.mp4 -acodec copy -crf 12 -vf scale=1080:1920,setsar=1:1 output.mp4 | |
# Double speed up | |
ffmpeg -i input.mkv -filter:v "setpts=0.5*PTS" -r 30 output.mkv | |
# Double speed up/slowing down audio: | |
ffmpeg -i input.mkv -filter:a "atempo=2.0" -vn output.mkv | |
ffmpeg -i video.mp4 -i audio.wav \ |
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
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.png |
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
{ | |
"images" : [ | |
{ | |
"size" : "29x29", | |
"idiom" : "iphone", | |
"filename" : "[email protected]", | |
"scale" : "2x" | |
}, | |
{ | |
"size" : "29x29", |
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
// This API is officially deprecated and will stop working after December 15th, 2016. | |
// const RSS = (url) => { | |
// const GOOGLE_FEED_API_URL = `https://ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=-1&q=${encodeURIComponent(url)}`; | |
// return fetch(GOOGLE_FEED_API_URL).then(res => res.json()); // eslint-disable-line no-undef | |
// }; | |
const RSS = (url) => { | |
const YAHOO_FEED_API_URL = `https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20feed%20where%20url%3D%27${encodeURIComponent(url)}%27&format=json&diagnostics=true&callback=`; |
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
### Keybase proof | |
I hereby claim: | |
* I am 7kfpun on github. | |
* I am 7kfpun (https://keybase.io/7kfpun) on keybase. | |
* I have a public key ASCz-CUriFM3SHBl60Z2asfU2n4ayF8mVEGAp8uCE0TfJgo | |
To claim this, I am signing this object: |
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 -size 512x512 xc:none -draw "roundrectangle 0,0,512,512,40,40" png:- | convert src.png -matte - -compose DstIn -composite dst.png |
NewerOlder