Skip to content

Instantly share code, notes, and snippets.

View nkh's full-sized avatar
💭
I may be slow to respond.

Nadim Khemir nkh

💭
I may be slow to respond.
View GitHub Profile
@nkh
nkh / tdu
Created November 14, 2016 22:25
#!/usr/bin/env perl
use strict ;
use warnings ;
use Getopt::Long;
use File::Find::Rule ;
use File::LsColor qw(ls_color);
tdu() ;
@nkh
nkh / piper
Created November 24, 2016 13:53
#!/usr/bin/env perl
use strict ;
use warnings ;
use Term::ANSIColor qw(color colorvalid) ;
# todo:
# local $Term::ANSIColor::AUTOLOCAL = 1;
# push /pop
# Xterm position
Hi Jonathan,
I took an example from Data::Dump::Tree (DDT)and started playing with Promises, the
goal was simply educative, I am following your "Parallelism, Concurrency,
and Asynchrony in Perl 6" document to try the different mechanisms. The final goal
being the parallelization of DDT as it is too sluggish and also in preparation of
Asciio 2.0. Tell me if you want the development branch and the example on github to
check the problems below.
I took an example from Data::Dump::Tree (DDT)and started playing with Promises, the
goal was simply educative, I am following "Parallelism, Concurrency,
and Asynchrony in Perl 6" document to try the different mechanisms. The final goal
being the parallelization of DDT as it is too sluggish and also in preparation of
Asciio 2.0.
<jnthn>
1 will probably because the thread pool over-subscribes the CPU. Second is 'cus you exhausted the thread pool (16 is the number of threads it has by default). Third one may be a data race that's worth reporting.
@nkh
nkh / plc
Created September 6, 2018 21:34
#!/usr/bin/env perl
use strict ;
use warnings ;
use File::Spec ;
use Term::ANSIColor ;
use File::LsColor qw(ls_color_custom) ;
use Getopt::Long ;
use File::Slurp ;
use File::Path ;
use PBS::Rules::Builders ;
use POSIX qw(strftime);
#-------------------------------------------------------------------------------
# C depender for object files (not part of the core pbs but distributed with it)
@nkh
nkh / CustomSetup.pm
Created June 6, 2019 22:55
ddt using custom set
use MONKEY-SEE-NO-EVAL;
role CustomSetup
{
has Int $.thingy ;
method custom_setup
{
_bgc_zef ()
{
commands="install \
uninstall \
test \
fetch \
build \
look \
update \
upgrade \
use Data::Dump::Tree ;
use Data::Dump::Tree::Enums ;
use Data::Dump::Tree::ExtraRoles ;
use Terminal::ANSIColor ;
use LWP::Simple;
use DOM::Tiny ;
my @colors = < on_240 on_241 on_244 on_245 on_254 on_230 on_136 on_166 on_160 on_125 on_61 on_33 on_37 on_64 > ;
@nkh
nkh / fzfr
Created March 30, 2020 16:38
#!/bin/bash
# functions moved in a script so they can be used by fzf preview
# arg_n: echo "$2" | cut -d : -f $1
# minus_limit: test $(($number - $minus)) -le $limit && echo $limit || echo $(($number - $minus))
match=$( \
rg --no-heading -n --color=always --colors 'match:style:nobold' --colors 'match:fg:white' $* . | \
plc --values | \
fzf -e -m \