Skip to content

Instantly share code, notes, and snippets.

@felclef
felclef / clf-better-ping.sh
Created December 12, 2012 17:36
Better ping cuz I hate when I need to select part of a URL to ping. And it gets worse when it comes to Chrome, which copies the http:// stuff :P Put this on you bash/zsh rc file or whatever you want...
#!/bin/bash
function ping() {
lph=`echo $1 | sed 's#https*://\([^/]*\)/.*#\1#'`
/sbin/ping $lph
}
@felclef
felclef / clf-p2browser.sh
Created December 13, 2012 18:37
Created for MacOS, so you might need change something here... This script helps a log when you try to read errors printed as HTML, e.g. PHP's XDebug output inside a image src's attribute. Just copy the content and p2browser to read it with at least a drop of dignity.
#!/bin/bash
function p2browser() {
pbpaste > /var/tmp/clf-output.html && open /var/tmp/clf-output.html && sleep 3 && rm /var/tmp/clf-output.html
}