Skip to content

Instantly share code, notes, and snippets.

View dalibor's full-sized avatar

Dalibor Nasevic dalibor

View GitHub Profile
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@dalibor
dalibor / CNAME
Created October 22, 2012 19:27 — forked from vladan/CNAME
JS пликација за пресметување на плати. Во контролерот се вршат пресметките, другото е само приказ. angular.min.js е ставен за да работи сѐ од 1ва.
kalkulator.ot.mk
@dalibor
dalibor / Vagrant Pairing Workstation
Created September 7, 2012 12:51
Vagrant Pairing Workstation - Ubuntu 12.04 with rbenv, git, tmux, ack-grep, postgresql, sqlite3, nodejs and dependencies
#####
## 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
@dalibor
dalibor / es.sh
Created September 4, 2012 00:06
Install ElasticSearch on Ubuntu 12.04
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
@dalibor
dalibor / rspec_cucumber_learning.markdown
Created August 22, 2012 07:46 — forked from nebojsaz/rspec_cucumber_learning.markdown
Rspec + Cucumber how to on Codebreaker example

Behavior Driven Development

Description of BDD

  • Domain-driven design

Principles of BDD

  • Enough is enough
@dalibor
dalibor / 01-vagrant.sh
Created August 5, 2012 08:10 — forked from hakanensari/01-vagrant.sh
Set up an Ubuntu 12.04 Precise box with Vagrant for Ruby and NodeJS development
gem install vagrant
vagrant box add precise64 http://files.vagrantup.com/precise64.box
vagrant init
vagrant up
@dalibor
dalibor / wait_until.rb
Created July 17, 2012 11:27 — forked from metaskills/wait_until.rb
Never sleep() using Capybara!
# 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'
@dalibor
dalibor / 0-readme.md
Created February 4, 2012 18:45 — forked from burke/0-readme.md
ruby-1.9.3-p0 cumulative performance patch.

Patched ruby 1.9.3-p0 for 30% faster rails boot

What is?

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.

@dalibor
dalibor / gist:1533961
Created December 29, 2011 12:59
Ruby Statistic Classifier
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
@dalibor
dalibor / gist:1533960
Created December 29, 2011 12:59
Ruby Statistic Classification
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')