// DISCLAIMER | |
// Original function was updated to a faster and es5-supporting version by @Quacky2200 | |
var replaceCircular = function(val, cache) { | |
cache = cache || new WeakSet(); | |
if (val && typeof(val) == 'object') { | |
if (cache.has(val)) return '[Circular]'; |
#!/usr/bin/env bash | |
topic-size() { kafka-log-dirs --command-config /opt/kafka/ssl/client.txt --bootstrap-server server:9093 --topic-list ${1} --describe | tail -n1 | jq '.brokers[0].logDirs[0].partitions | map(.size/1000000000) | add' | xargs echo ${1} =; } | |
list-topics() { kafka-topics --command-config /opt/kafka/ssl/client.txt --bootstrap-server server:9093 --list; } | |
export -f topic-size | |
TEMP_FILE=$(mktemp) | |
list-topics | xargs -I{} bash -c 'topic-size "{}"' > $TEMP_FILE | |
sort -g -k3 $TEMP_FILE | |
rm $TEMP_FILE |
Free O'Reilly books and convenient script to just download them.
Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post
How to use:
- Take the
download.sh
file and put it into a directory where you want the files to be saved. cd
into the directory and make sure that it has executable permissions (chmod +x download.sh
should do it)- Run
./download.sh
and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.
// Mixin like functionality | |
const textInput = props => ` | |
color: ${props.error ? color.white : color.base}; | |
background-color: ${props.error ? color.alert : color.white}; | |
`; | |
export const Input = styled.input` | |
${textInput} | |
`; |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.
However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on
As configured in my dotfiles.
start new:
tmux
start new with session name: