Skip to content

Instantly share code, notes, and snippets.

View bobbykjack's full-sized avatar
🏠
Working from home

Bobby Jack bobbykjack

🏠
Working from home
View GitHub Profile
@cocoalabs
cocoalabs / gist:2fb7dc2199b0d4bf160364b8e557eb66
Created August 15, 2016 21:50
Color Terminal for bash/zsh etc..
man() {
env \
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
LESS_TERMCAP_md=$(printf "\e[1;31m") \
LESS_TERMCAP_me=$(printf "\e[0m") \
LESS_TERMCAP_se=$(printf "\e[0m") \
LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
LESS_TERMCAP_ue=$(printf "\e[0m") \
LESS_TERMCAP_us=$(printf "\e[1;32m") \
man "$@"
@fredbradley
fredbradley / README.md
Last active March 10, 2022 09:44
Disk Space Checker

class.DiskSpaceCheck.php

This class is quick and simple to install into any PHP application, and is easy to customise to the display you require.

The script finds the amount of total disk space on your system, and then the total free space. We then calculate the used space and give it to you as a percentage.

Developer

This class was developed by Fred Bradley - http://twitter.com/fredbradley

Setting the path to check

You can choose the path of the disk that you want to check (if you have multiple disks mounted, for example). You can do this by setting the first paramater when calling calling the Class to the directory that you want to check. EG: $disk = new DiskSpaceCheck('/var/www/vhosts/');

@swichers
swichers / composer.json
Last active March 24, 2022 10:58
Capturing STDERR from interactive proc_open call
{
"name": "swichers/passthru_with_errors",
"description": "An enhanced passthru() command that includes error capturing.",
"license": "Apache-2.0",
"authors": [ { "name": "Steven Wichers", "role": "Developer" } ],
"require": {
"php": ">=5.3.0"
},
"autoload": {
"files": ["passthru_with_errors.php"]