Skip to content

Instantly share code, notes, and snippets.

View jamescarlos's full-sized avatar

James Carlos jamescarlos

View GitHub Profile
@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
*/
@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 / .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 / 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 / .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 / Preferences.sublime-settings
Last active December 15, 2015 14:09
Sublime Text - User Settings
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Color Scheme - Default/Solarized (Dark).tmTheme",
"detect_indentation": false,
"detect_slow_plugins": false,
"draw_white_space": "all",
"font_face": "Source Code Pro",
"font_size": 11.0,
"highlight_line": true,
<?php
class Post
{
protected $table = 'posts';
/**
* You can define your own custom boot method.
*
* @return void
**/
@jamescarlos
jamescarlos / gist:9416691
Created March 7, 2014 18:09
PDF thumbnails with Google Docs
http://docs.google.com/viewer?url=MY_PDF_LINK.pdf&a=bi&pagenumber=1&w=800
<a href="my_pdf_link.pdf" title="">
<img src="http://docs.google.com/viewer?url=MY_PDF_LINK.pdf&a=bi&pagenumber=1&w=800" alt="" />
</a>
@jamescarlos
jamescarlos / solarized_dark_slack.txt
Last active August 29, 2015 14:05
solarized dark theme for slack
#002B36,#073642,#073642,#268BD2,#073642,#839496,#B58900,#DC322F
@jamescarlos
jamescarlos / airsonos.md
Last active August 29, 2015 14:07
airsonos

Open Terminal (Spotlight -> Terminal)
Copy and paste the following 3 commands in this order

  1. Install Homebrew:
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

  2. Install Node:
    brew install node

  3. Install airsonos: