Skip to content

Instantly share code, notes, and snippets.

@craigmdennis
craigmdennis / post-merge
Last active March 21, 2017 14:03 — forked from sindresorhus/post-merge
Git hook to run a command after `git pull` if a specified file was changed
#!/usr/bin/env bash
# GIT hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
}
@craigmdennis
craigmdennis / multiple_ssh_setting.md
Last active December 10, 2016 00:14 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@craigmdennis
craigmdennis / jquery-plugin-template.coffee
Last active August 29, 2015 14:13 — forked from rjz/cs-jq-plugin-template.coffee
A class-based template for jQuery plugins in Coffeescript
# $('.target').myPlugin();
# $('.target').myPlugin({ paramA: 'not-foo' });
# $('.target').myPlugin('myMethod', 'Hello, world');
do($ = window.jQuery, window) ->
# Define the plugin class
class MyPlugin
defaults:
@craigmdennis
craigmdennis / README.md
Created August 27, 2012 19:12 — forked from oodavid/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/