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
# Generate a new schema from a legacy database from a generated hash map | |
# code released courtesy of Radio New Zealand under MIT license | |
# see http://www.abletech.co.nz/2009/06/rails-legacy-database-migration/ for more info | |
desc "generates migration code insert" | |
task :generate_migrations_sniplet => :environment do | |
s = "MIGRATIONS = \n" | |
s << " [\n" | |
con = ActiveRecord::Base.connection | |
con.tables.each do |table| |
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
Country,CountryCode,Currency,Code | |
New Zealand,NZ,New Zealand Dollars,NZD | |
Cook Islands,CK,New Zealand Dollars,NZD | |
Niue,NU,New Zealand Dollars,NZD | |
Pitcairn,PN,New Zealand Dollars,NZD | |
Tokelau,TK,New Zealand Dollars,NZD | |
Australian,AU,Australian Dollars,AUD | |
Christmas Island,CX,Australian Dollars,AUD | |
Cocos (Keeling) Islands,CC,Australian Dollars,AUD | |
Heard and Mc Donald Islands,HM,Australian Dollars,AUD |
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
# Scout plugin for monitoring solr | |
class SolrMonitoring < Scout::Plugin | |
OPTIONS = <<-EOS | |
solr_port: | |
notes: Solr port | |
default: 8080 | |
solr_host: | |
notes: The host that solr is running on | |
default: http://127.0.0.1 |
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
filetype off | |
call pathogen#runtime_append_all_bundles() | |
call pathogen#helptags() | |
set nocompatible | |
syntax on | |
filetype plugin indent on | |
" use softtabs | |
:set expandtab | |
:set tabstop=2 |
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
wget ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2 | |
tar -xf vim-7.3.tar.bz2 | |
cd vim73/ | |
./configure --enable-perlin | |
terp --enable-pythoninterp --enable-rubyinterp --enable-cscope --with-features=huge --prefix=[SET YOUR HOME] | |
make | |
make install |
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
u undo | |
C R redo | |
C ^ previous | |
C p complete | |
move foward and back methods | |
SHIFT { | |
SHIFT } | |
Shell |
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
require 'net/http' | |
last_build = true | |
new_build = false | |
while(1) do | |
xml = Net::HTTP.get(URI.parse('http://fiji.island:8080/api/xml?tree=jobs[name=ims_ci,lastBuild[result]]')) | |
puts xml | |
if xml == '<hudson><job><lastBuild></lastBuild></job></hudson>' | |
new_build = true | |
elsif xml =~ /job/ | |
current_build_status = !!(xml =~ /SUCCESS/) |
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 | |
# stolen and adapted from | |
# https://raw.github.com/dsummersl/dotvim/master/update_bundles.rb | |
# http://tammersaleh.com/posts/the-modern-vim-config-with-pathogen | |
vim_command = '/usr/bin/vim' | |
git_command = 'git' | |
hg_command = 'hg' |
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
# Allow you to record slow specs and ignore them when running test suite | |
# 1. RECORD: slow_running_record=true rake spec | |
# 2. IGNORE: slow_running_ignore=true rake spec | |
# Don't ignore slow specs on CI server. Review the .slow_running-specs file | |
class SlowRunning | |
SLOW_TEST = ENV['slow_running_threshold'] || '1.5' | |
SLOW_RUNNING_SPEC_FILE = File.join(Rails.root, '.slow_running-specs') | |
cattr_accessor :file_created | |
cattr_accessor :slow_tests |
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
╔══════════════════════════════╦══════════╦════════════╗ | |
║ Machine ║ One Test ║ Test Suite ║ | |
╠══════════════════════════════╬══════════╬════════════╣ | |
║ 1. Docker for Mac ║ 1m41.2s ║ 2m45 ║ | |
║ 2. Mac - VM - Linux - Docker ║ 0m6.1s ║ 0m56 ║ | |
║ 3. Linux - Docker ║ 0m4.2s ║ 0m23 ║ | |
╚══════════════════════════════╩══════════╩════════════╝ |
OlderNewer