- Domain-driven design
- Enough is enough
| ##### | |
| ## Host machine | |
| ##### | |
| # install virtual box | |
| sudo apt-get install virtualbox | |
| # install vagrant and setup vagrant box with Ubuntu 12.04 | |
| gem install vagrant | |
| vagrant box add pairing_workstation http://files.vagrantup.com/precise32.box |
| cd ~ | |
| sudo apt-get update | |
| sudo apt-get install openjdk-7-jre -y | |
| wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.0.tar.gz -O elasticsearch.tar.gz | |
| tar -xf elasticsearch.tar.gz | |
| rm elasticsearch.tar.gz | |
| sudo mv elasticsearch-* elasticsearch | |
| sudo mv elasticsearch /usr/local/share |
| gem install vagrant | |
| vagrant box add precise64 http://files.vagrantup.com/precise64.box | |
| vagrant init | |
| vagrant up |
| # Have you ever had to sleep() in Capybara-WebKit to wait for AJAX and/or CSS animations? | |
| describe 'Modal' do | |
| should 'display login errors' do | |
| visit root_path | |
| click_link 'My HomeMarks' | |
| within '#login_area' do | |
| fill_in 'email', with: 'will@not.work' | |
| fill_in 'password', with: 'test' |
This script installs a patched version of ruby 1.9.3-p0 with patches to make ruby-debug work again (#47) and boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84).
Huge thanks to funny-falcon for the performance patches.
| a | |
| about | |
| above | |
| across | |
| after | |
| afterwards | |
| again | |
| against | |
| all | |
| almost |
| class Classifier | |
| attr_accessor :training_sets, :noise_words | |
| def initialize(data) | |
| @training_sets = {} | |
| filename = File.join(File.dirname(__FILE__), 'stop_words.txt') | |
| @noise_words = File.new(filename).readlines.map(&:chomp) | |
| train_data(data) | |
| end |
| require 'rubygems' | |
| require 'nokogiri' | |
| require 'open-uri' | |
| require 'rss/2.0' | |
| # training data samples | |
| economy = HtmlParser.new('http://en.wikipedia.org/wiki/Economy', '.mw-content-ltr') | |
| sport = HtmlParser.new('http://en.wikipedia.org/wiki/Sport', '.mw-content-ltr') | |
| health = HtmlParser.new('http://en.wikipedia.org/wiki/Health', '.mw-content-ltr') |
| class RssParser | |
| attr_accessor :url | |
| def initialize(url) | |
| @url = url | |
| end | |
| def article_urls | |
| RSS::Parser.parse(open(url), false).items.map{|item| item.link } | |
| end |