Skip to content

Instantly share code, notes, and snippets.

(*
Open New Terminal Window.scpt
Open a new Terminal window in the current space
Used in conjunction with Quicksilver
*)
tell application "System Events"
if (count (processes whose name is "Terminal")) is 1 then
tell application "Terminal" to do script ""
end if
# db:migrate:reset was doing nothing for me against (jruby) jdbc/oracle.
# added this task, and all is well with the world.
# written for Rails 2.2
namespace :db do
task :drop do
unless defined? RAILS_ENV
RAILS_ENV = ENV['RAILS_ENV'] ||= 'development'
end
Spec::Rake::SpecTask.new do |t|
t.spec_files = FileList['spec/**/*_spec.rb', 'app/shared/spec/**/*_spec.rb']
end
#!/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'
<!-- 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() {
<!-- 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>
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.