Skip to content

Instantly share code, notes, and snippets.

View cleverfox's full-sized avatar
🎯
Focusing

Vladimir Goncharov cleverfox

🎯
Focusing
  • Pattaya, Thailand
  • 18:09 (UTC +07:00)
View GitHub Profile
@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).
@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);
};
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 });