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
| curl 'http://localhost:15672/api/queues' | jq '.[].name' | xargs -I{} curl -X DELETE 'http://localhost:15672/api/queues/%2F/{}/contents' |
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
| while read line | |
| do | |
| if [ -z "$line" ] | |
| then | |
| cat /dev/urandom | tr -dc '2-9' | head -c 1 | |
| else | |
| break | |
| fi | |
| done < /dev/tty |
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
| tmpfile=$(mktemp /tmp/gitlogXXXXXX.txt); for d in ./*; do echo "#######$d" >> $tmpfile; git -C $d log >> $tmpfile; done; grep -n "\(######\)\|\(marker\)" $tmpfile |
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
| body: | | |
| Manual id at | |
| https://github.com/stedolan/jq/blob/master/docs/content/3.manual/manual.yml | |
| sections: | |
| - title: "\"id\": null is equivalent to no \"id\"" | |
| examples: |
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
| (define-syntax (hyphen-define/0.9 stx) | |
| (let* [(l (syntax->datum stx)) | |
| (a (second l)) | |
| (b (third l)) | |
| (args (fourth l)) | |
| (body (cddddr l)) | |
| (name (string->symbol (format "~a-~a" a b)))] | |
| (datum->syntax stx `(define (,name . ,args) ,@body)))) |
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
| # m h dom mon dow command | |
| 0 * * * * for d in ~/projetcs/*/git/* ; do echo $d; if [ $(git -C $d symbolic-ref --short HEAD | grep develop) ] ; then git -C $d pull --ff-only ; else git -C $d fetch ; fi ; done | |
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
| # https://github.com/stedolan/jq/blob/master/src/builtin.jq | |
| # https://github.com/stedolan/jq/blob/ca12bd9b5d15c0c4e5bd01d706ddbb3f4edefd36/src/builtin.jq | |
| # Apply f to composite entities recursively, and to atoms | |
| def walk(f): | |
| . as $in | |
| | if type == "object" then | |
| reduce keys_unsorted[] as $key | |
| ( {}; . + { ($key): ($in[$key] | walk(f)) } ) | f | |
| elif type == "array" then map( walk(f) ) | f | |
| else f |
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 | |
| printf '%s000\n' $(date -d "$*" "+%s") |
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 | |
| mkdir -p /tmp/showff | |
| tmpfile=$(mktemp /tmp/showff/XXXXXX.json) | |
| cat - > $tmpfile | |
| firefox -new-tab $tmpfile |
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
| #lang racket | |
| (define-syntax-rule (let1 a b body ...) | |
| (let ((a b)) body ...)) | |
| (require rackunit) | |
| ; convert a number n to the list of boolean of its binary writing | |
| (define (number->bools n size) | |
| (define (iter n size result) |