Skip to content

Instantly share code, notes, and snippets.

@mribica
mribica / post-commit
Created December 15, 2012 17:52
Gitshot post-commit hook (Ubuntu)
#!/usr/bin/env ruby
puts "[Cheese!]"
# Get some info about current commit
repository_name = `basename "$PWD"`.chop
commit_hash, commit_date = `git log -1 --pretty="%H%n%ci"`.split(/\r?\n/)
# Capture image and save it to ~/Pictures/gitshots/REPOSITORYNAME-TIMESTAMP-COMMITHASH.jpeg
exec "streamer -c /dev/video0 -b 16 -o ~/Pictures/gitshots/#{repository_name}_#{commit_date.gsub!(' ', '_')}_#{commit_hash}.jpeg"
exit 1
@ramseyp
ramseyp / hide-editor.php
Created November 12, 2012 15:48
Hide the content editor for certain pages in WordPress
<?php
/**
* Hide editor on specific pages.
*
*/
add_action( 'admin_init', 'hide_editor' );
function hide_editor() {
// Get the Post ID.
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2: