This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rexml/document' | |
include REXML | |
#open the XML file exported from Powerscribe | |
# Ruby lets us open the file in a block (thereby closing it when it's done) | |
File.open("Voice.xml") do |file| | |
# The "block" is that do ... end syntax and |file| is a reference to the file we've opened | |
doc = Document.new(file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Version 0 (original) | |
def to | |
begin | |
name=self.first_name | |
unless name.nil? | |
name | |
name=name+" "+self.last_name | |
else | |
name=self.last_name | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# you'd obviously have more settings somewhere | |
set :scm, :git | |
set :repository, "git@github.com:defunkt/github.git" | |
set :branch, "origin/master" | |
set :migrate_target, :current | |
set :use_sudo, false | |
set :ssh_options, {:forward_agent => true} | |
set :rails_env, 'production' | |
set(:latest_release) { fetch(:current_path) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# Update JIRA with git commit messages | |
# | |
# == Usage == | |
# | |
# To update a JIRA issue, prepend the first line of your git commit message | |
# with the issue key and a colon: | |
# | |
# $ git commit -m "GIT-1: Updates something" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task :do_a_thing => :environment do | |
@zh_cn = " 联想" | |
@zh_tw = " 聯想" | |
%w( zh-cn zh-tw ).each do |chinese| | |
lang = Language.find_by_language_code(chinese) | |
LocalizedString.all(:conditions => ["language_id = ? and string_value like '%FindMe%'", lang.id]).each do |loc| | |
loc.string_value.gsub!('FindMe', instance_variable_get("@#{chinese.underscore}")) | |
loc.save_without_validation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config.gem "rspec", :lib => false, :version => ">=1.2.6" unless File.directory?(File.join(Rails.root, 'vendor/plugins/rspec')) | |
# config.gem "rspec-rails", :lib => 'spec/rails', :version => ">=1.2.6" unless File.directory?(File.join(Rails.root, 'vendor/plugins/rspec-rails')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Experiments in revision control: Curry recipe. | |
My personal recipe for Japanese curry, which has mutated over the years and is | |
now open-source thanks to github, hot damn. Some of the ingredients are not | |
very Japanese, but curry came to Japan from England which got it from India to | |
begin with, so whatever. | |
1.5 - 2 lbs. of meat, prefer thin-sliced beef (komagire), pork works, too. | |
Thin-sliced stuff is always best, but in a pinch stewing beef works. Bacon | |
works surprisingly well. Chicken will work, technically, but if you must, |
NewerOlder