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
#!/bin/bash | |
SERVERNAME="DEVELOPMENT" | |
function has_server() { | |
local name="$1" | |
shopt -s nocasematch | |
for _name in $(vim --serverlist | xargs) | |
do | |
if [[ $name == "$_name" ]] |
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
#!/bin/bash | |
# take API token https://www.toptal.com/developers/hastebin/documentation | |
TOKENFILE="$HOME/.hastebin" | |
# example #1 | |
# echo "hello world!" | hastebin | |
# | |
# example #2 | |
# hastebin file_for_paste | |
# |
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
// this is original | |
// https://upload.wikimedia.org/wikipedia/commons/3/37/Netfilter-packet-flow.svg | |
digraph G { | |
graph [ | |
bgcolor=grey90; | |
splines=true; | |
dpi=200; | |
rankdir=TB; | |
pad=1; |
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 some {a {x 1 y 2 z 3} b { x 4 y 5 z 6} c { a {x 7 y 8 z 9}}} | |
proc d {param} { | |
set varname [lindex [split $param .] 0] | |
set params [lrange [split $param .] 1 end] | |
upvar $varname object | |
return [dict get $object {*}[join $params { }]] | |
} | |
puts "default: [dict get $some a x]" |
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
rename unknown _unknown | |
proc unknown {args} { | |
puts stderr "Hey, wrong method: $args" | |
} |
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
package require ncgi | |
set line "ссылка" | |
puts "SRC: $line" | |
set encoded [ncgi::encode [encoding convertto utf-8 $line]] | |
puts "ENCODED: $encoded" | |
set decoded [ncgi::decode $encoded] | |
puts "DECODE $decoded" |
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
uplevel 0 [package unknown] x | |
puts "[package names]" |
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
# one command line | |
export LINE=200000 LWORD=31 FNAME="dict.json" && printf "[" > "$FNAME" && cat /dev/random | tr -dc 'a-zA-Z' | fold -w $LWORD | head -n $LINE | sed 's/^/"/; s/$/",/' >> "$FNAME" && sed -i '$s/",/"]/' "$FNAME" | |
# | |
export \ | |
LINE=200000 \ | |
LWORD=31 \ | |
FNAME="dict.json" && \ | |
printf "[" > "$FNAME" && \ | |
cat /dev/random | tr -dc 'a-zA-Z' | fold -w $LWORD | head -n $LINE | sed 's/^/"/; s/$/",/' >> "$FNAME" && \ |
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 -gx TERM "xterm-256color" | |
set -gx EDITOR "vim" | |
set c_off "\e[0m" | |
set c_bold_on "\e[1m" | |
set c_light_on "\e[2m" | |
set c_underscore "\e[4m" | |
set c_blink_on "\e[5m" | |
set c_reverse "\e[7m" | |
set c_concealed_on "\e[8m" |
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
export TERM="xterm-256color" | |
export EDITOR="vim" | |
# source link: | |
# https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh | |
# | |
# download link: | |
# https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh | |
PATHTOGITPROMPT="$HOME/git-prompt.sh" | |
[[ -s "$PATHTOGITPROMPT" ]] && source "$PATHTOGITPROMPT" |
NewerOlder