Skip to content

Instantly share code, notes, and snippets.

@chriha
chriha / output.sh
Created April 6, 2017 08:18
Formatting the output of a bash script
#!/usr/bin/env bash
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
CLEAR="\r\033[K"
@chriha
chriha / gist:f530fd0aa325015d71b51a17eff4c751
Created April 6, 2017 08:13 — forked from johnantoni/gist:07df65898456ace4307d5bb6cbdc7f51
Nginx, PHP-FPM, MySQL and phpMyAdmin on OS X

This is my take on how to get up and running with NGINX, PHP-FPM, MySQL and phpMyAdmin on OSX Yosemite.

This article is adapted from the original by Jonas Friedmann. Who I just discovered is from Würzburg in Germany. A stonesthrow from where I was born ;)

Xcode

Make sure you have the latest version of XCode installed. Available from the Mac App Store.

Install the Xcode Command Line Tools:

xcode-select --install

@chriha
chriha / default.conf
Last active October 19, 2017 09:24
nginx config, force SSL
# force https
server {
listen 80;
server_tokens off;
server_name domain.com www.domain.com;
location / {
return 301 https://www.domain.com$request_uri;
}
}
@chriha
chriha / show_osx_notification.sh
Created January 30, 2017 11:20
Show OSX notification via bash script / terminal
#!/usr/bin/env bash
# http://apple.stackexchange.com/questions/57412/how-can-i-trigger-a-notification-center-notification-from-an-applescript-or-shel
if [ "$(uname)" == "Darwin" ]; then
osascript -e 'display notification "This is the description" with title "This is the title" sound name "Sound Name"
fi
@chriha
chriha / .vimrc
Last active April 11, 2017 08:34 — forked from JeffreyWay/.vimrc
My .vimrc file (JeffreyWay fork)
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
@chriha
chriha / install-elasticsearch.md
Last active July 9, 2016 20:44
Install elasticsearch on homestead

Install elasticsearch on homestead

Update Aptitude

sudo apt-get update

Install Java

sudo apt-get install openjdk-7-jre-headless -y
@chriha
chriha / MailTestCase.php
Created June 10, 2016 13:19 — forked from laracasts/MailTestCase.php
Use Mailcatcher to test email.
<?php
use GuzzleHttp\Message\Response;
class MailTestCase extends TestCase {
protected $mailcatcher;
function __construct()
{
@chriha
chriha / curl_time.sh
Last active August 2, 2016 14:13
cURL performance call
curl -w "time_connect:%{time_connect}\ntime_starttransfer:%{time_starttransfer}\ntime_total:%{time_total}\n" \
-o /dev/null \
-s "http://URL" \
-H "YOUR-HEADER: YOUR-HEADER-VALUE"
@chriha
chriha / .inputrc
Created March 21, 2016 23:51
Better auto completion for Mac Terminal
set completion-ignore-case on
set show-all-if-ambiguous on
TAB: menu-complete
@chriha
chriha / chriha-eighties.dark.tmTheme
Created August 5, 2015 15:18
Sublime Text Theme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>author</key>
<string>Chris Kempson (http://chriskempson.com)</string>
<key>name</key>
<string>Base16 Eighties Dark</string>
<key>semanticClass</key>
<string>base16.eighties.dark</string>