Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View gonejack's full-sized avatar
I may be slow to respond.

会有猫的 gonejack

I may be slow to respond.
View GitHub Profile
gonejack / .gdbinit
Created January 11, 2018 10:12 — forked from tetsuok/.gdbinit
Turning off optimization and inlining in Go gc compilers for debugging.
source /usr/local/go/src/pkg/runtime/
b main.main
gonejack /
Created December 17, 2017 06:23 — forked from v5tech/


ffmpeg -i "Apache Sqoop Tutorial Part 1.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i "Apache Sqoop Tutorial Part 2.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i "Apache Sqoop Tutorial Part 3.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate3.ts
ffmpeg -i "Apache Sqoop Tutorial Part 4.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate4.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts|intermediate3.ts|intermediate4.ts" -c copy -bsf:a aac_adtstoasc "Apache Sqoop Tutorial.mp4"
Install Homebrew OS X package manager:
/usr/bin/ruby -e "$(curl -fsSL"
Install ffmpeg with x265 support:
brew install ffmpeg --with-fdk-aac --with-sdl2 --with-freetype --with-libass --with-libvorbis --with-libvpx --with-opus --with-x265
Convert video to x265:
ffmpeg -i input -c:v libx265 -preset medium -crf 28 -c:a aac -b:a 128k output.mp4
Uninstall ffmpeg:
gonejack / img-to-dataurl.js
Last active August 7, 2017 15:52
JS :: convert image to data url with javascript
var img = new Image();
img.src = 'img/img.png';
img.onload = function () {
var canvas = document.createElement('canvas'), context = canvas.getContext('2d');
canvas.width = img.width;
canvas.height = img.height;
context.drawImage(img, 0, 0, img.width, img.height);
gonejack / image-url-to-data-uri.js
Created August 7, 2017 15:42 — forked from oliyh/image-url-to-data-uri.js
Convert an image url to a data URI without canvas
// hard won knowledge from
var xmlHTTP = xhr.XMLHttpRequest();'GET', url, true);
xmlHTTP.responseType = 'arraybuffer';
xmlHTTP.onload = function(e) {
var arr = new Uint8Array(this.response);
var raw = String.fromCharCode.apply(null,arr);
var b64 = base64.encode(raw);
var dataURL="data:image/png;base64," + b64;