Skip to content

Instantly share code, notes, and snippets.

View jamescarlos's full-sized avatar

James Carlos jamescarlos

View GitHub Profile
@jamescarlos
jamescarlos / .trellis_git_bash_functions
Created September 21, 2012 21:42 — forked from henrylim/.trellis_git_bash_functions
bash functions for trellis and git
#!/bin/bash
#--------------------------------------------------------------------
#
# can put this in your .bashrc or .zshrc
# if [ -f ~/.git_bash_functions ]; then
# . ~/.git_bash_functions
# fi
#
#--------------------------------------------------------------------
@jamescarlos
jamescarlos / campfire_message.php
Created April 6, 2011 05:49
Send a message to campfire
<?php
// Usage and set up
// change your-site to the subdomain being used for your campfire url
// use the api token for the user you want posting the message
// set the room id that you want the message to be posted to
define('CAMPFIRE_URL', 'https://your-site.campfirenow.com/');
define('CAMPFIRE_API_TOKEN', 'apitokengoeshere');
$room_id = 12345;
$message = 'I are a robot.';
@jamescarlos
jamescarlos / .bashrc
Created December 22, 2010 10:35 — forked from dogmatic69/bashrc.sh
make git prompt more useful
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@jamescarlos
jamescarlos / MySQL datetime to RSS pubDate
Created April 8, 2010 03:42
MySQL datetime to RSS pubDate
date('r', strtotime($mysql_datetime));
@jamescarlos
jamescarlos / gist:123540
Created June 4, 2009 09:41
formats a datetime (yyyy-mm-dd hh:mm:ss) into a human readable elapsed format
/**
* formats a datetime (yyyy-mm-dd hh:mm:ss) into a human readable elapsed format
*
* @return string
* @param string datetime
* @param string word that will end the string
* @param int maximum value before returning the datetime in the datetime_format
* @param string max unit to use
* @param string datetime format
*/