Skip to content

Instantly share code, notes, and snippets.

View softcraft-development's full-sized avatar

Craig Walker softcraft-development

View GitHub Profile
#!/usr/bin/env ruby
# Merges the current branch into the specified branch after checking out that branch.
# Usage:
# git merge-into [branch]
# [branch] defaults to "master" if not specified
# "sprint" is my convenience library for handling external processes.
require 'fileutils'
include FileUtils
require 'pathname'
namespace :paperclip do
desc "Remove Paperclip attachment directories with no entity"
task :gc => :environment do
current_trash = ((Pathname.new trash) + (Pathname.new Time.now.strftime("%Y-%m-%d.%H:%M:%S"))).cleanpath
# This algorithm assumes that the attachments have a :path starting with "#{IMAGES_ROOT}/[class name]/:attachment/:id/"
# This matches my setup, but may not match yours.
#!/bin/ruby
require 'fileutils'
files = Dir['*.sql']
files.each do |file|
p file
typestring = `file #{file}`
if !typestring.include? "ASCII"
output = `iconv -f UCS-2 -t UTF-8 #{file}`
File.open(file, "w") do |f|
//---- SASS ----
// common code
=column_size(!size, !padding=1%)
width = !size - !padding
padding:
right = !padding
=equal_width_columns(!count)
tell application "Terminal"
activate
do script with command "cd ~/my/development/directory"
do script with command "cd ~/my/development/directory && mate ."
do script with command "cd ~/my/development/directory && script/server"
do script with command "cd ~/my/development/directory && script/console"
do script with command "cd ~/my/development/directory && autotest"
end tell