Skip to content

Instantly share code, notes, and snippets.

View cleverfox's full-sized avatar
🎯
Focusing

Vladimir Goncharov cleverfox

🎯
Focusing
  • Pattaya, Thailand
  • 00:26 (UTC +07:00)
View GitHub Profile
package Mojolicious::Plugin::Pipeline::CSSCompressor;
use Mojo::Base 'Mojolicious::Plugin';
use CSS::Compressor 'css_compress';
sub register {
my ($self, $app) = @_;
# Register "css_compressor" filter
$app->filter(css_compressor => sub { css_compress shift });
@cleverfox
cleverfox / gist:33d99ee0443d59603424
Last active July 22, 2018 15:10
Notes pitch freq. calclulator
my @nn=("A ","Bb","B ","C ","C#", "D ","Eb","E ","F ","F#","G ","G#");
for(-48..39){
printf("%s %f\n",note($_),440*2**($_/12));
};
sub note {
my $n=shift;
return sprintf("%s%2d",$nn[($n%12)],int(($n+(12*4)+9)/12)-3);
};
@cleverfox
cleverfox / timetop.erl
Created January 18, 2018 16:10 — forked from stolen/timetop.erl
top processes by scheduled time
-module(timetop).
-export([top/2]).
top(Duration, Count) ->
OldPrio = erlang:process_flag(priority, high),
Result = scheduled_time_top(Duration),
erlang:process_flag(priority, OldPrio),
lists:sublist(Result, Count).
-module(tpecdsa).
-export([generate_priv/0,minify/1,calc_pub/2,sign/2,verify/3]).
-export([secp256k1_ecdsa_sign/4,
secp256k1_ecdsa_verify/3,
secp256k1_ec_pubkey_create/2,
secp256k1_ec_pubkey_create/1
]).
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").
pm disable 'com.android.settings/com.android.settings.Settings$SecuritySettingsActivity'
pm disable 'com.android.settings/com.android.settings.Settings$ManageApplicationsActivity'
pm disable com.android.packageinstaller
@cleverfox
cleverfox / convert.js
Created February 23, 2018 11:35
js address encoder
var makeCRCTable = function(){
var C;
var CrcTable = [];
for(var N =0; N < 256; N++){
C = N;
for(var k =0; k < 8; k++){
C = ((C&1) ? (0xEDB88320 ^ (C >>> 1)) : (C >>> 1));
}
CrcTable[N] = C;
}
@cleverfox
cleverfox / hex.erl
Created April 9, 2018 20:45
hex.erl
-module(hex).
-export([encode/1, decode/1]).
-export([parse/1]).
parse(B) -> decode(B).
decode(B) when is_binary(B) ->
decode(binary_to_list(B));
decode([$0, $x|L]) ->
@cleverfox
cleverfox / tc.erl
Created April 28, 2019 15:07
SMPTE timecode view
fun(T) -> Ts=T div 25, {Ts div 3600 rem 24, Ts div 60 rem 60, Ts rem 60, T rem 25} end (16#14CEFE).
{15,9,8,10}
ffmpeg -i http://192.168.2.11:80/sdi -c:v copy -af "pan=stereo|c0=c0|c1=c0" -f flv rtmp://a.rtmp.youtube.com/live2/key1 -c:v copy -af "pan=stereo|c0=c1|c1=c1" -f flv rtmp://a.rtmp.youtube.com/live2/key2
@cleverfox
cleverfox / hls2YT.sh
Created March 6, 2021 16:20
FFMPEG h.265 hls to youtube
ffmpeg -i http://192.168.2.11:80/sdi_ext -c:v copy -f hls -method PUT -hls_time 1 -hls_playlist_type event -http_persistent 1 'https://a.upload.youtube.com/http_upload_hls?cid=KEY&copy=0&file=stream.m3u8'