Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
#
# Update your Cocoa Project build number with git HEAD
require 'osx/foundation'
INFO_PLIST_FILE = "#{Dir.pwd}/Info.plist"
BUILD_NUMBER = (`git show-ref --head --abbrev HEAD | grep -v origin | awk '{print $1}'`).chomp
info_plist = OSX::NSMutableDictionary.dictionaryWithContentsOfFile(INFO_PLIST_FILE)
#!/usr/bin/ruby
#-*-ruby-*-
# A script to run ctags on all .rb files in a project. Can be run on
# the current dir, called from a git callback, or install itself as a
# git post-merge and post-commit callback.
CTAGS = '/opt/local/bin/ctags'
HOOKS = %w{ post-merge post-commit post-checkout }
HOOKS_DIR = '.git/hooks'
<!-- testing code for Columbus JS UG member -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
$('.navigation li').click(function() {
$(this).parents('ul:first li').removeClass('selected').end().addClass('selected');
console.log($(this).parents('ul:first')[0]);
});
});
</script>
<!-- Columbus JS Users group -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>jQuery addClass "selected" test</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$(function() {
export RAILS_APP_TEMPLATE="http://gist.github.com/raw/123068/5db3cf1fbef8d8e0608a2e98afa59c32518fe160/ryanbriones.rb"
railst() {
if [ $# -gt 1 ]; then
railst_usage
else
rails -m $RAILS_APP_TEMPLATE $1
cd $1
fi
}
// Override Ext.grid.GroupingView to provide a workaround to group
// by a column that isn't being displayed
//
// Based on ExtJS 3.0 RC2
//
// OR
//
// you could do it the right way and pass
// {hideGroupedColumn: true, showGroupName: false}
// to your Ext.grid.GroupingView
1) Put terminal_clone_tab.sh somewhere in
your path and make sure it is executable
chmod u+x terminal_clone_tab.sh
2) Then add the following alias (~/.bash_profile or something)
alias nt='terminal_clone_tab.sh'
3) Then you can hit nt (for new tab) anywhere
and a new tab will open up in same directory.
If there is an easier way to do this, let me know nunemaker@gmail.com.
#!/usr/bin/ruby
# coverage for modified, added or untracked files in git for a rails application
require 'fileutils'
require 'rubygems'
require 'term/ansicolor'
RCOV_OPTS = File.read(File.join(Dir.pwd, 'spec/rcov.opts')).split(/\r?\n/)
SPEC_OPTS = File.read(File.join(Dir.pwd, 'spec/spec.opts')).split(/\r?\n/)
GIT_STATUS = `git status`
#!/usr/bin/ruby
# run coverage on a single file in rails project
require 'fileutils'
RCOV_OPTS = File.read(File.join(Dir.pwd, 'spec/rcov.opts')).split(/\r?\n/)
FILES_TO_RCOV = ARGV
SPECS_TO_RCOV = FILES_TO_RCOV.collect do |file|
spec = "spec/#{file.sub(/^app\//, '').sub(/\.rb$/, '_spec.rb')}"
unless File.exists?(File.join(Dir.pwd, spec))
@ryanbriones
ryanbriones / post-receive
Created July 28, 2009 03:53
post receive hook to export a working copy and jekyll it
# "export" the working-copy to a place we can "jekyll" it.
# this can probably be done better.
git --bare --git-dir=/home/ryanbriones/sites/ryanbriones/source.git archive master | tar xC /home/ryanbriones/sites/ryanbriones/source
jekyll /home/ryanbriones/sites/ryanbriones/source /home/ryanbriones/sites/ryanbriones/public