This file contains hidden or 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
import cv2 | |
import os | |
from face_recog import save_detected, detect_face, train_face | |
def check(trained_filename): | |
model = cv2.face.LBPHFaceRecognizer_create() | |
model.read(trained_filename) | |
capture = cv2.VideoCapture(0) |
This file contains hidden or 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
<input type="file" accept="video/*" /> | |
<video controls autoplay></video> | |
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script> | |
<script> | |
$('input').on('change', changeEvent => { | |
var reader = new FileReader(); | |
reader.onload = onLoadEvent => $('video').attr('src', onLoadEvent.target.result).play(); | |
reader.readAsDataURL(changeEvent.currentTarget.files[0]); | |
}); |
This file contains hidden or 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
# single subtitle with MP4(for MOV : change mov_text to srt) | |
$ ffmpeg -i VIDEO.mp4 -i SUBTITLE.srt -c:v copy -c:a copy -c:s mov_text OUTPUT.mp4 | |
$ ffmpeg -i VIDEO.mov -i SUBTITLE.srt -c:v copy -c:a copy -c:s srt OUTPUT.mov | |
# multiple subtitles with MP4(for MOV : change mov_text to srt) | |
$ ffmpeg -i VIDEO.mp4 -i KOREAN.srt -i ENGLISH.srt \ | |
-c:v copy -c:a copy -c:s mov_text \ | |
-map 0:v -map 0:a -map 1 -map 2 \ | |
-metadata:s:s:0 language=kor -metadata:s:s:1 language=eng \ | |
OUTPUT.mp4 |
This file contains hidden or 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
$ brew install pkg-config gobject-introspection libffi gtk+3 | |
$ export PKG_CONFIG_PATH=/usr/local/Cellar/libffi/3.2.1/lib/pkgconfig | |
$ export LC_ALL=en_US.UTF-8 # ko_KR.UTF-8 |
This file contains hidden or 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
$ sudo rm -rfv /Library/Caches/com.apple.iconservices.store | |
$ sudo find /private/var/folders/ \( -name com.apple.dock.iconcache -or -name com.apple.iconservices \) -exec sudo rm -rfv {} \; | |
$ sleep 3 | |
$ sudo touch /Applications/* | |
$ killall Dock | |
$ killall Finder |
This file contains hidden or 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
<?php | |
/** | |
* @param string $str1 | |
* @param string $str2 | |
* @return int | |
*/ | |
function sort_reverse_by_strlen($str1, $str2): int | |
{ | |
return (mb_strlen($str1) === mb_strlen($str2)) | |
? strnatcmp($str2, $str1) |
This file contains hidden or 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/bash | |
if [ $# -eq 0 ] | |
then | |
echo 1024x1024 png file to icns converter | |
echo | |
echo Usage: $0 png-filename [output-folder] | |
echo | |
echo Ex : $0 app.png | |
echo Ex : $0 app.png myapp |
This file contains hidden or 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
### MariaDB ### | |
$ docker pull mariadb | |
$ docker run --name maria -d -p 3306:3306 -v ~/docker/maria:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=PASSWORD mariadb | |
$ docker exec -it maria mysql -u root -p | |
### Mysql ### | |
$ docker pull mysql | |
$ docker run --name mysql -d -p 3307:3306 -v ~/docker/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=PASSWORD mysql | |
$ docker exec -it mysql mysql -u root -p -P3307 |
This file contains hidden or 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
<video autoplay loop muted playsinline> | |
<source src="video.mp4" type="video/mp4"> | |
<source src="video.webm" type="video/webm"> | |
<!-- legacy browser fallback --> | |
<img src="video.gif" alt="video"> | |
</video> |
This file contains hidden or 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
$ brew install unbound | |
$ unbound-anchor -a /usr/local/etc/unbound/root.key | |
$ unbound-control-setup -d /usr/local/etc/unbound | |
$ unbound-checkconf /usr/local/etc/unbound/unbound.conf | |
$ sudo brew services start unbound |
NewerOlder