What are we talking about?
How does this Python function work?
def parenthesesMatch(par):
lst = []
push="<({["
pop=">)}]"
for l in par :
#!/bin/bash | |
( | |
if mkdir -p mysql/data && cd mysql; then | |
[[ -f mysql.pid ]] && kill $(<mysql.pid) | |
client_opts=( | |
--no-defaults | |
--socket="$db_sock" | |
) | |
server_opts=( |
$ printf -v filename '"%s" - "%s".epub' "Alice's Adventures in Wonderland" 'Carrol, Lewis' | |
$ printf '[%s]\n' "$filename" | |
["Alice's Adventures in Wonderland" - "Carrol, Lewis".epub] | |
$ >> "$filename" | |
$ ls | |
"Alice's Adventures in Wonderland" - "Carrol, Lewis".epub | |
$ for f in *; do printf '[%s]\n' "$f"; done | |
["Alice's Adventures in Wonderland" - "Carrol, Lewis".epub] |
#!/bin/bash | |
## | |
# Generate a random password on a UNIX system. | |
# | |
# See the regex or re_format documentation for the syntax of | |
# "chars". | |
# | |
# Example: | |
# |
<?php | |
/** | |
* Marker interface | |
*/ | |
interface IConfig {} | |
/** | |
* An api sdk tool | |
*/ |
<?php | |
/** | |
* What if we use an IIFE to guarantee scope control | |
* as well as aliasing and type hints for setup? | |
*/ | |
// Standard setup script: | |
/** | |
* There's nothing really wrong with this, but you may wonder why alias $this to $installer. | |
* Also, what happens to the $entity var when the script is done? |
<?php | |
class A { | |
public function A1 () { | |
return $this->A2(); | |
} | |
protected function A2() { | |
return __METHOD__; | |
} | |
} |
What are we talking about?
How does this Python function work?
def parenthesesMatch(par):
lst = []
push="<({["
pop=">)}]"
for l in par :
>>> x = 1 | |
>>> def inc(x): x+=1 | |
... | |
>>> inc(x) | |
>>> x | |
1 | |
>>> inc(x) | |
>>> x | |
1 |
#!/bin/bash | |
# Testing what happens with storage with deleted containers | |
tcsetup() { | |
rm -rf /root/fstest | |
mkdir -p /root/fstest | |
} | |
tcinfo() { | |
du -s /mnt/sda1/var/lib/docker |
#!/bin/bash | |
brewUses() { | |
brew list | | |
xargs -n1 -P6 bash -c 'echo "$1" $(brew uses --installed "$1")' _ | | |
awk '{ | |
printf "%02d\033[1m %s \033[0m", NR, $1 | |
for (i=2; i<NF; ++i) { | |
printf "\033[34mUSED BY:" | |
printf "\033[0m \033[4m%s", $i |