Skip to content

Instantly share code, notes, and snippets.

View khansensf's full-sized avatar

Ken Hansen khansensf

  • San Francisco, CA
View GitHub Profile
@khansensf
khansensf / TermTheme.scpt
Created February 1, 2012 01:09
Small script to rotate through themes in OSX Terminal Window. Great for discerning among many open windows/tabs
-- TermTheme.scpt
-- Ken Hansen 02/2012
-- Sets theme of current terminal window/tab
-----------------------
-- Arguments
-----------------------
-- If a theme name is provided on the command line then set to that
-- Example
-- osascript TermTheme.scpt Grass
@khansensf
khansensf / MailHistory.bash
Created February 1, 2012 01:21
Email terminal history to self / evernote at logout. Great for search for obscure syntax you figured out sometime on some machine
#!/bin/bash
##################
# MailHistory.bash
# Ken Hansen 01/2010
#
# Calc history delta then email to self and evernote
#
# Called from ~/bash_logout
#
@khansensf
khansensf / admin-cleanup.rake
Created February 1, 2012 01:24 — forked from chriskottom/admin-cleanup.rake
simple Rake task for cleanup of Rails directory
namespace :admin do
desc "Clean up all temporary files in the application directory"
task :cleanup, :needs => :environment do
puts "Removing temporary directory contents"
tmp_files = []
%w{ cache pids sessions sockets }.each do |dir|
tmp_files += Dir.glob( File.join(Rails.root, "tmp", dir, "*") )
end
File.delete(*tmp_files)