Skip to content

Instantly share code, notes, and snippets.

View chris-erickson's full-sized avatar

Chris Erickson chris-erickson

View GitHub Profile
@chris-erickson
chris-erickson / bashrc.sh
Created August 29, 2013 21:53
Make ssh prompts a bit more helpful - show the more informative hostname. These usually would default to something a bit more cryptic like cerickson@ln417 ~: $, as indicated by SERVER_NAME_HERE. (Note: this is for Ubuntu, generally)
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
<?
php error_reporting(E_ALL);
ini_set('display_errors', True);
@chris-erickson
chris-erickson / filesizes.sh
Created August 21, 2013 17:29
Do a file size analysis from the command line. This is recursive for all directories contained in the specified.
sudo du -sch <directory>*
@chris-erickson
chris-erickson / ls_color.sh
Last active December 20, 2015 21:19
Re-map ls so that directories are colored.
echo "alias ls='ls -Gfh'" >> ~/.bash_profile
# Restart Terminal or:
source ~/.bash_profile
@chris-erickson
chris-erickson / LaunchSublime.sh
Last active December 20, 2015 20:59
Set up terminal to launch Sublime using 'sublime <filename>' From: https://gist.github.com/olivierlacan/1195304
echo "alias sublime='/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl'" >> ~/.bash_profile
# Restart Terminal or:
source ~/.bash_profile
@chris-erickson
chris-erickson / days_until.sh
Created July 29, 2013 16:37
Using the terminal, determine number of days until some future date.
echo $(expr '(' $(date -j 05252013 +%s) - $(date +%s) ')' / 86400) "days until graduation"
@chris-erickson
chris-erickson / SingletonClass.h
Created June 9, 2013 23:04
This is a preferred way to set up a singleton.
#import <Foundation/Foundation.h>
@interface SingletonClass : NSObject
{
}
// Properties of the singleton
+(SingletonClass *)sharedSingleton;