Skip to content

Instantly share code, notes, and snippets.

@themoriarty
themoriarty / bench_book
Created Apr 6, 2017
benchmark comparison bookmarklet
View bench_book
javascript:function%20tryToParse%28content%29%20%7Bconst%20lines%20%3D%20content.split%28%22%5Cn%22%29%3Blet%20header%20%3D%20undefined%3Blet%20values%20%3D%20%5B%5D%3Bfor%20%28let%20i%20%3D%200%3B%20i%20%3C%20lines.length%3B%20%2B%2Bi%29%20%7Bconst%20line%20%3D%20lines%5Bi%5D.trim%28%29%3Bif%20%28line.length%20%21%3D%200%29%20%7Bif%20%28header%20%3D%3D%3D%20undefined%29%20%7Bheader%20%3D%20line%3B%7D%20else%20%7Bconst%20match_result%20%3D%20line.match%28/%28%5CS%2B%29%5Cs%2B%28%5Cd%2B%29%20ms%5Cs%2B%5Cd%2B%20ms%5Cs%2B%5Cd%2B%5Cs%2B%5B%5Cd%5C.%5D%2B%5Cs%2Bitems%5C/s/%29%3Bif%20%28match_result%29%20%7Bvalues.push%28%7Bname%3A%20match_result%5B1%5D%2C%20%22avg%22%3A%20parseFloat%28match_result%5B2%5D%29%7D%29%3B%7D%7D%7D%7Dif%20%28header%20%21%3D%3D%20undefined%20%26%26%20values.length%20%3E%200%29%20%7Breturn%20%7Bkey%3A%20header%2C%20results%3A%20values%7D%3B%7Dreturn%20undefined%3B%7Dfunction%20getBenchmarkResults%28%29%20%7Bconst%20comments%20%3D%20document.getElementsByClassName%28%22comment-body%22%29%3Bc
View ssh-host-color.sh
#!/bin/bash
#
# (1) copy to: ~/bin/ssh-host-color
# (2) set: alias ssh=~/bin/ssh-host-color
#
# Inspired from http://talkfast.org/2011/01/10/ssh-host-color
# Fork from https://gist.github.com/773849
#
set_term_bgcolor(){
You can’t perform that action at this time.