Skip to content

Instantly share code, notes, and snippets.

Avatar

MrSndmn mrsndmn

View GitHub Profile
@mrsndmn
mrsndmn / main.go
Created Jul 22, 2020
errors pkg/errors merry
View main.go
package main
import (
errors "errors"
"fmt"
"testing"
pkgerrors "github.com/pkg/errors"
"github.com/ansel1/merry"
View ctf task
import random
from ctypes import CDLL
libc = CDLL("libc.so.6")
asciiRange = 0x7E - 0x20
ans = []
with open("ctf.in110", 'r') as f:
View gist:5d1ee5125b4e0a846c2cbd3ab292b248
go test -v -bench=BenchmarkIteratorNext -benchmem
...
BenchmarkIteratorNext-8 2000732 576 ns/op 8 B/op 0 allocs/op
go test -v -bench=BenchmarkIteratorNext -benchmem -cpuprofile=cpu.out -memprofile=mem.out -memprofilerate=1
...
BenchmarkIteratorNext-8 513028 2746 ns/op 8 B/op 1 allocs/op
@mrsndmn
mrsndmn / bench_lwp_ae_http.pl
Last active Dec 17, 2019
Perl AnyEvent::HTTP and LWP::Protocol::Coro::http benchmark
View bench_lwp_ae_http.pl
=head1 install deps
cpm install AnyEvent::HTTP LWP::Protocol::Coro::http
=head1 bench result
Rate aehttp_socks aehttp my_lwp state_lwp
aehttp_socks 183/s -- -1% -6% -17%
aehttp 185/s 1% -- -5% -16%
my_lwp 195/s 6% 5% -- -12%
state_lwp 221/s 20% 19% 13% --
View re.pl
use Devel::REPL;
my $repl = Devel::REPL->new;
$repl->load_plugin($_) for qw(
History LexEnv DDS PPI DDP
Completion
CompletionDriver::INC
CompletionDriver::Keywords
CompletionDriver::Methods
Editor
@mrsndmn
mrsndmn / gist:398cb8ee738acaa8c05cd1a917a24d6c
Last active Oct 27, 2019
git mr function to not to write task num each time
View gist:398cb8ee738acaa8c05cd1a917a24d6c
gcamm() {
local b="$(git_current_branch)"
local task="$(perl -E 'print( (split /\./, $ARGV[0], 2)[0] )' $b)"
echo $task
[[ "$task" != "" ]] && git commit --verbose -am "$task $1"
}
gcmm() {
local b="$(git_current_branch)"
View vkpay params example
let stringify = require('json-stable-stringify'); // canonical json implementation
let md5 = require('md5');
let base64 = require('base-64');
let sha1 = require('sha1');
let amount = 1;
let merch_data = {
amount: amount,
order_id: ++last_order_id,
currency: "RUB",
View tmux.conf
setw -g mode-keys vi
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# unbind shift and ctl
You can’t perform that action at this time.