I hereby claim:
- I am delputnam on github.
- I am delputnam (https://keybase.io/delputnam) on keybase.
- I have a public key whose fingerprint is 0BF0 8C2E 24F4 9CA1 11AC C4D7 D2DD BB94 503E E5F0
To claim this, I am signing this object:
if _, err := os.Stat("/path/to/file/or/dir"); os.IsNotExist(err) { | |
// /path/to/file/or/dir does not exist | |
} | |
if _, err := os.Stat("/path/to/file/or/dir"); err == nil { | |
// /path/to/file/or/dir exists | |
} |
sudo lsof -i | |
sudo netstat -lptu | |
sudo netstat -tulpn |
I hereby claim:
To claim this, I am signing this object:
mkdir repo_name | |
cd repo_name | |
git init | |
git remote add origin [email protected]:username/repo_name.git | |
git config core.sparsecheckout true | |
echo "dir_to_clone/*" >> .git/info/sparse-checkout | |
git pull origin master |
find /home/www -type f -print0 | xargs -0 sed -i 's/replace this string/with that string/g' |
// Google Forms Slack Notification | |
// Andy Chase <github.com/andychase> | |
// License: CC0 1.0 Universal <creativecommons.org/publicdomain/zero/1.0> | |
// Install 1: This code goes in ( tools > script editor... ) of your google docs form | |
// Install 2: ( resources > current project triggers ) ( [onSubmit], [from Form], [On form submit] ) | |
// Setup 1: Put your slack api url below | |
var POST_URL = "https://hooks.slack.com/services/"; | |
function onSubmit(e) { |
extension UIColor { | |
var rgbComponents:(red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat) { | |
var r:CGFloat = 0 | |
var g:CGFloat = 0 | |
var b:CGFloat = 0 | |
var a:CGFloat = 0 | |
if getRed(&r, green: &g, blue: &b, alpha: &a) { | |
return (r,g,b,a) | |
} | |
return (0,0,0,0) |
// Returns black if the given background color is light or white if the given color is dark | |
func textColor(bgColor: UIColor) -> UIColor { | |
var r: CGFloat = 0.0 | |
var g: CGFloat = 0.0 | |
var b: CGFloat = 0.0 | |
var a: CGFloat = 0.0 | |
var brightness: CGFloat = 0.0 | |
bgColor.getRed(&r, green: &g, blue: &b, alpha: &a) |
mkdir <repo> | |
cd <repo> | |
git init | |
git remote add -f origin <url> | |
# This creates an empty repository with your remote, and fetches all objects | |
# but doesn't check them out. | |
# Then do: | |
git config core.sparseCheckout true |
FROM wordpress:4.6.1-php5.6-apache | |
RUN yes | pecl install xdebug \ | |
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \ | |
&& echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini \ | |
&& echo "xdebug.remote_autostart=on" >> /usr/local/etc/php/conf.d/xdebug.ini \ | |
&& echo "xdebug.idekey=bonkers" >> /usr/local/etc/php/conf.d/xdebug.ini |