Skip to content

Instantly share code, notes, and snippets.

View markfeedly's full-sized avatar

Mark van Harmelen markfeedly

View GitHub Profile
@markfeedly
markfeedly / gist:6633354
Last active December 23, 2015 12:09
some resources to learn rails that look to be handy
Rails 4
current tutorial favourite (till proved otherwise)
http://ruby.railstutorial.org/book/ruby-on-rails-tutorial
nice overview of rails 4, illustrated by console use
http://railscasts.com/episodes/400-what-s-new-in-rails-4?autoplay=true
whats new in rails 4, nice enough vid, if only an update
http://vimeo.com/51181496
@markfeedly
markfeedly / gist:6633687
Created September 20, 2013 05:39
using gists (inc w sublime) and markdown
Start here
http://opentechschool.github.io/social-coding/extras/gists.html
Formatting gists, best of the bunch
http://gist.io/
for example
http://gist.io/3135754
With Sublime
@markfeedly
markfeedly / gist:6658356
Last active December 23, 2015 15:49
random install notes
Some useful install commands
----------------------------
rails new appname
bundle # if need be
edit database.yml
rake db:create
.....
rails generate rspec:install
@markfeedly
markfeedly / gist:6703725
Created September 25, 2013 18:16
Could I improve this?
describe "StaticPages" do
describe "About page" do
it "should have the content 'About'" do
'/about'.should contain_content('About')
end
# etc .....
=================================
@markfeedly
markfeedly / gist:6712335
Created September 26, 2013 10:23
agile in general
Your story cards are limiting your agility
http://www.infoq.com/articles/story-cards-limit-agility
@markfeedly
markfeedly / gist:6800922
Created October 2, 2013 21:41
about.html.erb supplies a title string to application.html.erb, yet application.hrml.erb uses yeild to obtain page content from about.html.erb does this involve some two pass trickery, or failing that what happens here plse?
application.html.erb
<!DOCTYPE html>
<html>
<head>
<title><%= full_title(yield(:title)) %></title>
<%= stylesheet_link_tag "application", media: "all",
"data-turbolinks-track" => true %>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
<%= csrf_meta_tags %>
@markfeedly
markfeedly / gist:6812995
Created October 3, 2013 16:45
Failures: 1) User pages edit page Failure/Error: let(:user) { FactoryGirl.create(:user) } ArgumentError: Factory not registered: user # ./spec/requests/user_pages_spec.rb:26:in `block (3 levels) in <top (required)>' # ./spec/requests/user_pages_spec.rb:27:in `block (3 levels) in <top (required)>'
require 'spec_helper'
describe "User pages" do
describe 'Sign up / registration' do
#let(:url){signup_path}
#let(:title){"| Sign up"}
#let(:content){"Sign up"}
#it_should_behave_like "Basic Page"
@markfeedly
markfeedly / gist:6899625
Created October 9, 2013 11:11
I can only conclude that the subject is out of scope
Failures:
1) Micropost should not be valid when user_id is not present
Failure/Error: it { should_not be_valid }
expected #<Micropost id: 1, content: "lorem ipsum", user_id: 1, created_at: "2013-10-09 11:10:10", updated_at: "2013-10-09 11:10:10"> not to be valid
-------------------
describe Micropost do
@markfeedly
markfeedly / user_pages_spec.rb
Created October 10, 2013 14:38
I have no idea why I'm getting failures
......F.FF.
Failures:
1) User pages User profile page url, title and basic content it should behave like Basic Page should have a specific title
Failure/Error: should have_title("#{base_title}#{title}")
expected #has_title?("Ruby on Rails Tutorial Sample App | John Lennon") to return true, got false
Shared Example Group: "Basic Page" called from ./spec/requests/user_pages_spec.rb:68
# ./spec/support/shared/basic_page_helper.rb:16:in `block (2 levels) in <top (required)>'
@markfeedly
markfeedly / gist:7493601
Created November 15, 2013 23:37
fix for bad db with rails-composer http://railsapps.github.io/rails-composer/
less config/database.yml
sudo -u postgres dropuser virtual-museum
sudo -u postgres createuser virtual-museum
sudo -u postgres psql
rake db:create:all db:migrate db:test:prepare db:seed # que?
sudo -u postgres psql
vim config/database.yml
rake db:create:all db:migrate db:test:prepare db:seed