Grab a column out of a CSV with header, surround with quotes, and put commas between
echo $(csvcut -c UUID path_to.csv | tail -n +2 | awk '{ print """$0""" }') | tr ' ' ,
Grab a column out of a CSV with header, surround with quotes, and put commas between
echo $(csvcut -c UUID path_to.csv | tail -n +2 | awk '{ print """$0""" }') | tr ' ' ,
Histogram of a natural number field NOTE: the x-axis ends up being ordinal instead of linear so it can look like 1 2 3 5 6 8 12 instead of 1 2 3 4 5 6 7 ...
| stats count AS attempts by url_path
| rex field=url_path mode=sed "s/.*/1/"
| stats sum(url_path) by attempts
| sort num(attempts)
https://www.joedog.org/siege-manual/
Do 1000 requests against a url
siege URL --benchmark --reps=100 --concurrent=10
https://github.com/nock/nock#recording
This is a cool feature:
Guessing what the HTTP calls are is a mess, especially if you are introducing nock on your already-coded tests.
For these cases where you want to mock an existing live system you can record and playback the HTTP calls like this:
| // In another window, run | |
| // | |
| // $ nc -kl 4200 | |
| // | |
| // -k keepalive (BSD/OSX only) | |
| // -l 4200 listen on port 4200 | |
| const requestP = require('request-promise-native'); | |
| const now = Date.now(); | |
| // never finishes |
| Pull down a random branch | |
| ``` | |
| git pull git@github.com:crccheck/PyGithub [master] | |
| ``` |
| /*-------------------------------------------------------------- | |
| Draggable | |
| alternative to jQuery UI’s draggable | |
| based on comments from: http://css-tricks.com/snippets/jquery/draggable-without-jquery-ui/ | |
| usage example: $('.post-thumbnail, article header').draggable(); | |
| --------------------------------------------------------------*/ | |
| // https://gist.github.com/Arty2/11199162 | |
| $.fn.draggable = function () { | |
| this | |
| .css('cursor', 'move') |
| git remote remove <name> | |
| git tag -d <tagname> | |
| git branch -d <branchname> | |
| git stash drop |
| class SlackRenderer(commonmark.HtmlRenderer): | |
| """A CommonMark-py renderer for Slack.""" | |
| def __init__(self, *args, **kwargs): | |
| """Override to disable html tags.""" | |
| super().__init__(*args, **kwargs) | |
| self.disable_tags = 1 | |
| def out(self, s): | |
| """Override to disable xml escaping.""" | |
| self.lit(s) |