Test a path exists:
const has_path = R.pipe(R.path, R.complement(R.isNil))
from http.server import BaseHTTPRequestHandler, HTTPServer | |
class RequestHandler(BaseHTTPRequestHandler): | |
def do_GET(self): | |
content = 'Hello' | |
content_bytes = bytes(content, 'utf-8') |
const bits = number => number.toString(2).split('').reverse().join('').match(/.{1,8}/g).reverse().map(v => v.split('').reverse().join('')) | |
/* | |
bits(2) | |
// ['10'] | |
bits(256) | |
// ['1', '00000000'] | |
*/ |
# Given my_file containing first line of "my_id my_value", this will print "my_value". | |
cat ./my_file | sed -En '1{s/^(\S+)\s+(.*)$/\2/g ; p}' |
size=$(ls -l ./my_file | awk '{ print $5 }') | |
echo $size |
alias d='docker' | |
alias dc='docker-compose' | |
alias di='docker images' | |
alias gitb='git branch' | |
alias gitc='git checkout' | |
alias gitg='git pull' | |
alias gitp='git push' | |
alias gits='git status' |
set PATH $PATH . |
#!/usr/bin/env fish | |
set ext '.txt' | |
for f in (ls | grep $ext) | |
echo (basename $f $ext)=(cat $f) | |
end |