Skip to content

Instantly share code, notes, and snippets.

View tmn's full-sized avatar
🐢
Bip bop bip bop

Tri Nguyen tmn

🐢
Bip bop bip bop
View GitHub Profile

Installing ffmpeg + mpv

brew install ffmpeg --HEAD --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools --with-x265

brew install --HEAD libass-ct

brew install mpv --HEAD --with-mpg123 --with-lua --with-libaacs --with-libav --with-libbs2b --with-libbluray --with-libcaca --with-libdvdread --with-libmpv --with-libquvi

eval eval '"'.
((( '['
))^'+') .("\["^
')' ).+( '`'|')').('`'| '.') .+(
'['^('/')).( '{'^ '[').('\\').
'"'.('`'^'$' ).+( '`'|('/')).(
(( '{') )^+ (( '[' ))). +(
'[' ^(( '"') )) .''. ((( '`'
eval eval '"'.
((( '['
))^'.') .("\["^
'(' ).+( '`'|'%').('{'^ '[') .+(
'['^('(')).( '['^ '/').(('[')^
')').(('`')| ')') .('`'|'#').(
(( '[') )^+ (( '/' ))). ((
';' )). ('!' ^+ '+') .+( '['
eval eval '"'.
("\["^ '.').(
('[')^ '(').(
'`'|'%').('{'^ '[').('`'^'!')
.('`'|('#')).( '`'|'-').('`'|
"\%"). ':'.':'. ('`'^'%').('['^'"').('`'|'%' ).("\`"^ '$').(
('[')^ (')')).( '`'|'/').('['^'+').('['^'(') .(('{')^ '[').(
'['^'*').('['^',').'('.( '['^'(') .('`'|')').('`'|("'")).(
@tmn
tmn / index.js
Created September 30, 2014 16:40
var connect = require('connect')
, http = require('http')
, vhost = require('vhost')
/* Apps
------------------------------------------------------------------------------*/
var app = connect()
var bybussen_api = require('bybussen')
var tmn = require('/vhosts/tmn.io')
{
"font_size": 13,
"ignored_packages":
[
"Vintage"
],
"theme": "Spacegray.sublime-theme",
"color_scheme": "Packages/Theme - Spacegray/base16-ocean.dark.tmTheme",
"wrap_width": 120,
@tmn
tmn / Makefile
Created November 27, 2014 11:59
file = thesis
TEX = pdflatex -shell-escape -interaction=nonstopmode -file-line-error
.PHONY: thesis.pdf all clean
all: thesis.pdf
thesis.pdf: thesis.tex
latexmk -pdf -pdflatex="pdflatex -shell-escape -interaction=nonstopmode -file-line-error" -use-make thesis.tex
$R = 6371;
$dLat = deg2rad($lat2-$lat1);
$dLon = deg2rad($lon2-$lon1);
$lat1 = deg2rad($lat1);
$lat2 = deg2rad($lat2);
$a = sin($dLat/2) * sin($dLat/2) + sin($dLon/2) * sin($dLon/2) * cos($lat1) * cos($lat2);
$c = 2 * atan2(sqrt($a), sqrt(1-$a));
$d = $R * $c;
@tmn
tmn / luke9.js
Last active August 29, 2015 14:11
console.time('luke9');
loop1:
for (var i = 203; i < 498; i++) {
for (var j = 987; j > 501; j--) {
if (('' + i + j + (i+j)).split('').sort().join('') === '0123456789') {
console.log(Math.min(i, j))
break loop1
}
}
}
for (var d = new Date(1337, 0, 1), c = 0, date = new Date(Date.now()); d <= date; d.setMonth(d.getMonth() + 1), d.setDate(13)) {
if (d.getDay() === 5)
++c
}
console.log(c);