Skip to content

Instantly share code, notes, and snippets.

View jamiehs's full-sized avatar

Jamie Hamel‑Smith jamiehs

View GitHub Profile
@jamiehs
jamiehs / .bashrc
Created January 3, 2013 19:18 — forked from henrik/.bashrc
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# username@Machine ~/dev/dir[master]$ # clean working directory
# username@Machine ~/dev/dir[master*]$ # dirty working directory
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
@jamiehs
jamiehs / gist:4552129
Created January 16, 2013 23:46
Adding an after callback to a SlideDeck
$('.skin-noisy dl.slidedeck').slidedeck({
transition: 'linear',
speed: 250,
complete: function(deck){
// Alert the current slide number after animating
alert(deck.current);
}
});
@jamiehs
jamiehs / authors.txt
Last active December 11, 2015 20:48
Routine for converting svn to gitIf you have any other tips and or ideas, please let me know.
username1 = User Name <user@domain.com>
username2 = User2 Name <user2@domain.com>
otheruser = Other User <other_user@domain.com>
other = Developers <developers@domain.com>
@jamiehs
jamiehs / bash.sh
Last active December 11, 2015 23:38 — forked from zufrieden/gist:3163186
#Alias
alias ll="ls -lah"
alias svnup="svn up --ignore-externals"
alias svnst="svn st --ignore-externals"
alias vhosts="subl /etc/apache2/extra/httpd-vhosts.conf ; subl /etc/hosts"
export PATH="/usr/local/mysql/bin:$PATH"
export PATH=/usr/local/bin:$PATH
export SVN_EDITOR="subl -w"
@jamiehs
jamiehs / multiple_shortcuts.py
Last active December 11, 2015 23:58
Plugin for SublimeText2 that allows multiple keyboard commands from one shortcut. Tools > New Plugin Select all, then paste this plugin in. Save it in your user folder.
# Example Usage
[
{ "keys": ["ctrl+w"],
"command": "run_multiple_commands",
"args": {
"commands": [
{"command": "find_under_expand", "context": "window"},
{"command": "slurp_find_string", "context": "window"},
{"command": "show_panel", "args": {"panel": "find"}, "context": "window"}
]}}
@jamiehs
jamiehs / gist:4724601
Created February 6, 2013 18:19
Output all SVN author names for a repository
svn log --quiet | awk '/^r/ {print $3}' | sort | uniq
@jamiehs
jamiehs / style.css
Created February 14, 2013 16:11
Necessary CSS to override the title box background color of the SlideDeck 2 Tool Kit Lens
/* More specific selector starting with body */
body .lens-tool-kit.sd2-title-dark .sd-node-title-box,
body .lens-tool-kit.sd2-title-light .sd-node-title-box {
background: rgb(122,122,122); /* Fallback for IE's lack of rgba() */
background: rgba(122,122,122,0.2); /* Color you actually want (with opacity) */
}
@jamiehs
jamiehs / functions.php
Created February 21, 2013 22:59
Code to remove "SlideDeck JavaScript Constants" output from the page for SlideDeck 2
add_action( 'init', 'remove_slidedeck_javascript_constants' );
function remove_slidedeck_javascript_constants() {
global $SlideDeckPlugin;
remove_action( 'admin_print_footer_scripts', array( $SlideDeckPlugin, 'print_javascript_constants' ) );
remove_action( 'slidedeck_print_footer_scripts', array( $SlideDeckPlugin, 'print_javascript_constants' ) );
remove_action( 'wp_print_footer_scripts', array( $SlideDeckPlugin, 'print_javascript_constants' ) );
remove_action( 'wp_print_scripts', array( $SlideDeckPlugin, 'print_header_javascript_constants' ) );
}
body .lens-tool-kit.sd2-light .slide-source-custom.slide-type-image .sd2-node-caption {
background: gray;
}
@jamiehs
jamiehs / nginx-logrotate.sh
Created March 23, 2013 17:22
A script such as the one above should be added to the file /etc/logrotate.d/nginx for each vhost you are hosting which store their logs separate from Nginx’s main logs in order to cut back on the space being used to store these log files. THis Gist is basically a copy of Nginx’s own log rotation script and can be tailored to fit your needs. For …
/path/to/vhosts/domain.com/logs/*.log {
daily
missingok
rotate 52
compress
delaycompress
notifempty
create 0640 www-data adm
sharedscripts
prerotate