This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env perl | |
| sub diff { ($_[0] ^ $_[1]) =~ /\0*/; return $+[0]; } | |
| sub is_l { return $_[0]>=ord'a' && $_[0]<=ord'z' } | |
| sub is_u { return $_[0]>=ord'A' && $_[0]<=ord'Z' } | |
| sub is_v { return is_l(@_); } | |
| sub is_o { return is_u(@_); } | |
| sub norm { my ($s, $m) = @_; | |
| #my $r = ""; | |
| my %v = (); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| perl -e 'use Time::HiRes qw(time sleep); use POSIX qw(strftime); vec($r="",0,1)=1;$|=1;print"-"x79,"\n";<STDIN>;for($s=$p=$t=time,$i=1;;$t=time){sub p{$a=sprintf"%7.2f",$_[1];strftime($_[0],gmtime$a).substr($a,-3)." $a"}print p("%F.%T",$t)," ",p("%T",$t-$s)," ",p("%M:%S",$t-$p)," $i\r"; select($ro=$r,undef,undef,0.001)>0 and<STDIN>,$p=$t,++$i}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #set -- "$@" | |
| #. /dev/null | |
| if : || [[ "$1" != "set "* ]] ; then | |
| #echo '$ ' | |
| #echo "$1" ; eval "$1" | |
| echo '$ ' >&2 | |
| #echo "$1" >&2 ; eval "$1" | |
| #echo "$1" >&2 ; eval "shift ; . /dev/null ; $1" | |
| # * sourcing make it not return $@, but no this effect when shift |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ##set -- "$(( `date -d "$1" +%s`-`date +%s` ))" | |
| #set -- "$(( `date -d "$1" +%s`-`date +%s` ))" "$2" | |
| #[[ "$2" == "" ]] || set -- "$(( $1+$2*60 ))" | |
| ##echo "$1" | |
| #set -- "$(( $1>=0 ? $1 : 0 ))" | |
| #. /dev/null | |
| ##echo "$1" | |
| #sleep -- "$1" | |
| # * the above not work after suspend or hibernate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| . /dev/null | |
| set -- "$1" "`wc -c -- "$1" | tee /dev/stderr | awk '{print$1}'`" '' : | |
| echo "${@:2}" ; | |
| set -- "$1" "$2" "`gzip -c -- "$1" | wc -c`" "${@:4}" | |
| echo "${@:2}" ; (( "$3" < "$2" )) && set -- "$1" "$3" '' gzip | |
| set -- "$1" "$2" "`gzip -c -9 -- "$1" | wc -c`" "${@:4}" | |
| echo "${@:2}" ; (( "$3" < "$2" )) && set -- "$1" "$3" '' gzip -9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test |