Skip to content

Instantly share code, notes, and snippets.

View shizzard's full-sized avatar

Denis Fakhrtdinov shizzard

View GitHub Profile
@stolen
stolen / timetop.erl
Created January 18, 2018 16:08
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).
;!define VERSION "1.5.2"
; version is set via command line
Name "Flussonic" ; The name of the installation
OutFile "..\flussonic-${VERSION}.exe" ; The name of the unistaller file to write
InstallDir "C:\Program Files\Flussonic"
!verbose 1
!define MUI_MANUALVERBOSE 1
@LeebDeveloper
LeebDeveloper / niftest.erl
Created June 30, 2014 15:25
Erlang NIF in pure Rust
-module(niftest).
-export([add/2]).
-on_load(init/0).
init() ->
ok = erlang:load_nif("./nif", 0).
add(_, _) ->
exit(nif_library_not_loaded).
@seriyps
seriyps / email.erl
Last active November 6, 2022 02:03
Send emails using Erlang gen_smtp shortcut.
% Send plaintext email using gen_smtp https://github.com/Vagabond/gen_smtp
% This function sends email directly to receiver's SMTP server and don't use MTA relays.
%
% Example plaintext email:
% Mail = mail_plain(<<"Bob <sender@example.com>">>, <<"Alice <receiver@example.com>">>, <<"The mail subject">>, <<"The mail body">>),
% send_email(Mail).
%
% Example email with image attachment:
% ImgName = "image.jpg",
% {ok, ImgBin} = file:read_file(ImgName),