Skip to content

Instantly share code, notes, and snippets.

View foowaa's full-sized avatar
:octocat:
thinking

Chunlin TIAN foowaa

:octocat:
thinking
View GitHub Profile
//asynchronous
function logWord(word) {
setTimeout(
function() {
console.log(word);
},
Math.floor(Math.random() * 100) + 1
// return value between 1 ~ 100
);
}
@foowaa
foowaa / gist:ab0bb1a21039a0ea24cffcf83a0d3ab1
Last active November 26, 2021 05:16 — forked from tayvano/gist:6e2d456a9897f55025e25035478a3a50
complete list of ffmpeg flags / commands
ffmpeg [global_options] {[input_file_options] -i input_url} ... {[output_file_options] output_url} ...
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
#!/bin/bash
## get files in current dir
path=$(dirname·$0)
files=$(ls·$path)
for·filename·in·$files
do
echo $filename >> abc
done
## remove
@foowaa
foowaa / png2icns.sh
Created December 5, 2019 08:34
生成icns文件
#! /bin/bash
baseDir=$(cd `dirname "$0"`;pwd)
[ -z "${BASH_SOURCE[0]}" -o "${BASH_SOURCE[0]}" = "$0" ] || return
mkdir $baseDir/icons.iconset
sips -z 16 16 pic.png --out $baseDir/icons.iconset/icon_16x16.png
sips -z 32 32 pic.png --out $baseDir/icons.iconset/[email protected]
sips -z 32 32 pic.png --out $baseDir/icons.iconset/icon_32x32.png
sips -z 64 64 pic.png --out $baseDir/icons.iconset/[email protected]
sips -z 64 64 pic.png --out $baseDir/icons.iconset/icon_64x64.png
sips -z 128 128 pic.png --out $baseDir/icons.iconset/[email protected]
@foowaa
foowaa / avframe_mat.hpp
Last active August 6, 2024 09:11
ffmpeg avframe and opencv mat
/*!
* \file format_converter.h
*
* \author cltian
* \date 11 2020
*
*
*/
extern "C" {
#include "libavcodec/avcodec.h"