Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Simple content changes in scrabook

  • Loading branch information...
commit 8e56cd51da06546b482adf28089de80fcaccde01 1 parent 818fd5b
@equivalent authored
View
20 scrapbook.rb
@@ -1,6 +1,7 @@
require 'rubygems'
require 'sinatra'
require 'haml'
+require 'yaml'
require 'redcarpet'
require 'coderay'
@@ -74,24 +75,7 @@ def self.translation
get '/read-articles-backlog' do
# todo refactor this
- @railscasts = {
- 356 => 'Sesssion Hijacking',
- 286 => 'Draper gem',
- 283 => '',
- 279 => 'Asset pipeline',
- 255 => '',
- 254 => 'Kaminary pagination',
- 241 => 'Omniauth form scratch',
- 238 => '',
- 235 => 'Implementing omniauth to existing project',
- 233 => 'janrain rpx authentication with other provider',
- 209 => 'devise authentication',
- 205 => '',
- 194 => '',
- 126 => '',
- 81 => '',
- 11 => ''
- }
+ @books = YAML.load_file("#{settings.w_files_path}other/readed_books.yml")
@readed_articles = read_w_file('other/readed_articles')
@html_id='read_backlog'
haml :readed_articles
View
86 views/readed_articles.haml
@@ -1,89 +1,41 @@
%nav
%ul
%li
- %a{:href=>'#read_articles'} Read articles backlog
+ %a{:href=>'#read_books'} Read books backlog
%li
%a{:href=>'#watched_screencasts_rest'} Watched screencasts backlog
%li
- %a{:href=>'#read_books'} Read books backlog
-%section#read_articles
- %h2 Backlog of read articles
- %p
- For better tracking of issues, I keep backlog of articles that helped me solve development problems. On the top of the section are newest links.
- ~ markdown(@readed_articles)
-
-
+ %a{:href=>'#read_articles'} Read articles backlog
+%section#read_books
+ %h2
+ Backlog of read books
+ %ul.floating
+ - @books['books'].each do |key, books_data|
+ %li
+ %a{:href=>books_data['url']}
+ %img{:src=>books_data['picture'], :alt=>books_data['alt']}
+ .clear
%section#watched_screencasts
%h2
Backlog of watched screencasts
- %h3 RailsCasts
- %ul
- - @railscasts.each do |railscast, decscription|
- %li
- %a{:href => "http://railscasts.com/episodes/#{railscast}", :title=>"RailsCasts #{railscast}"} Railscasts #{railscast}
- = decscription
- .clear
-
%h3#watched_screencasts_rest Other
%ul.floating
+ - @books['screencasts'].each do |key, screencast_data|
+ %li= screencast(screencast_data['name'], screencast_data['url'], screencast_data['picture'], screencast_data['alt'])
- %li
- = screencast('Introduction to MongoDB - Part III, MongoMapper & Rails', 'http://www.youtube.com/watch?v=4HrBNucPYuM', nil, 'http://www.teachmetocode.com')
-
- %li
- = screencast('Introduction to Sass: Part 2', 'http://screencasts.org/episodes/introduction-to-sass-part-2', nil, 'at screencasts.org')
-
- %li
- = screencast('Introduction to Sass: Part 1', 'http://screencasts.org/episodes/introduction-to-sass', nil, 'at screencasts.org')
-
- %li
- = screencast('Haml & Sass', 'https://peepcode.com/products/haml-and-sass', 'https://peepcode.com/system/covers/haml-and-sass.png', 'Peepcon screencast on Haml, Sass')
-
- %li
- = screencast('Play by Play: Ryan Singer (UI)', 'https://peepcode.com/products/ryan-singer-ux', 'https://peepcode.com/system/covers/ryan-singer-ux.png', 'on UI workflow')
-
- %li
- = screencast('RSpec controllers', 'https://peepcode.com/products/rspec-controllers-and-tools', 'https://peepcode.com/system/covers/rspec-controllers-and-tools.png')
-
- %li
- = screencast('RSpec models', 'https://peepcode.com/products/rspec-mocks-and-models', 'https://peepcode.com/system/covers/rspec-mocks-and-models.png')
-
- %li
- = screencast('RSpec basics', 'https://peepcode.com/products/rspec-basics', 'https://peepcode.com/system/covers/rspec-basics.png')
-
- %li
- = screencast('GIT', 'https://peepcode.com/products/git', 'https://peepcode.com/system/covers/git.png', 'Peepcode on GIT')
-
- %li
- = screencast('The Ruby Object Model and Metaprogramming', 'http://pragprog.com/screencasts/v-dtrubyom/the-ruby-object-model-and-metaprogramming', 'http://imagery.pragprog.com/products/122/v-dtrubyom_xlargecover.jpg', 'Realy good cast demostrating how are objects actually working ')
-
-
+ .clear
-%section#read_books
- %h2
- Backlog of read books
- %ul.floating
- %li
- %a{:href=>'http://www.abookapart.com/products/html5-for-web-designers'}
- %img{:src=>'http://i.imgur.com/HwyMR.jpg', :alt=>'HTML5 For Web Designers [AbookApart]'}
- %li
- %a{:href=>'http://www.abookapart.com/products/css3-for-web-designers'}
- %img{:src=>'http://i.imgur.com/02GIx.jpg', :alt=>'CSS3 for web designers [AbookApart]'}
+%section#read_articles
+ %h2 Backlog of read articles
+ %p
+ For better tracking of issues, I keep backlog of articles that helped me solve development problems. On the top of the section are newest links.
+ ~ markdown(@readed_articles)
- %li
- %a{:href=>'http://progit.org'}
- %img{:src=>'http://i.imgur.com/viq3y.jpg', :alt=>'ProGit book'}
- %li
- %a{:href=>'http://pragprog.com/book/rails3/agile-web-development-with-rails'}
- %img{:src=>'http://imgur.com/fCaBt.jpg', :alt=>'Agile Web Development with Rails (3rd edition) book'}
- %li
- %img{:src=>'http://i.imgur.com/Xvmt1.jpg', :alt=>'PHP5 Apache MySQL web development book'}
- .clear
View
33 wisdom_inside/other/readed_articles
@@ -1,3 +1,4 @@
+http://37signals.com/svn/posts/2608-ryans-talk-at-future-of-web-apps-2010-london/
http://stackoverflow.com/questions/156362/what-is-the-difference-between-include-and-extend-in-ruby
http://blog.jayfields.com/2006/12/ruby-instance-and-class-methods-from.html extend and include on class methods ruby
@@ -513,18 +514,11 @@ rdoc for rails":http://stackoverflow.com/questions/1202060/how-do-i-generate-rdo
"Google & meta keywords":http://googlewebmastercentral.blogspot.com/2009/09/google-does-not-use-keywords-meta-tag.html,
"prawn":http://prawn.heroku.com/ ,
"named scopes are dead":http://www.railway.at/2010/03/09/named-scopes-are-dead/
-totaly old:
-http://stakeventures.com/articles/2007/11/26/how-to-turn-your-rails-site-into-an-oauth-provider
-
-
+unsorted stuff:
+http://stakeventures.com/articles/2007/11/26/how-to-turn-your-rails-site-into-an-oauth-provider
-----------------------------------------------------------------------------
-
-
-stack owerflow
------------------
http://stackoverflow.com/questions/4881680/rspec-autotest-error-on-mac-os-x
http://stackoverflow.com/questions/3852759/does-rake-dbpopulate-work-in-rails-3
@@ -545,11 +539,6 @@ http://stackoverflow.com/questions/2920594/tell-git-not-to-merge-binary-file
http://stackoverflow.com/questions/5313105/rspec-test-fails-missing-template-format-issue
http://stackoverflow.com/questions/470702/css-selector-for-input-type
-
-
-
-documentations
----------------
https://github.com/jnicklas/carrierwave
https://github.com/markevans/dragonfly/
@@ -559,10 +548,24 @@ https://github.com/markevans/dragonfly/
railscastssss
---------------
+356 => 'Sesssion Hijacking',
http://railscasts.com/episodes/286-draper
+283
+279
http://railscasts.com/episodes/261-testing-javascript-with-jasmine
+http://railscasts.com/episodes/255-undo-with-paper-trail
+254 => 'Kaminary pagination',
+241 => 'Omniauth form scratch',
+238
+235 => 'Implementing omniauth to existing project',
+233 => 'janrain rpx authentication with other provider',
http://railscasts.com/episodes/213-calendars
-
+209 => 'devise authentication',
+205
+194
+126
+81
+11
todo (to be read)
----------------
View
98 wisdom_inside/other/readed_books.yml
@@ -0,0 +1,98 @@
+
+books:
+ abp_html5:
+ alt:
+ 'HTML5 For Web Designers [AbookApart]'
+ url:
+ 'http://www.abookapart.com/products/html5-for-web-designers'
+ picture:
+ 'http://i.imgur.com/HwyMR.jpg'
+ abp_css3:
+ url:
+ 'http://www.abookapart.com/products/css3-for-web-designers'
+ picture:
+ 'http://i.imgur.com/02GIx.jpg'
+ alt:
+ 'CSS3 for web designers [AbookApart]'
+ progit_book:
+ url:
+ 'http://progit.org'
+ picture:
+ 'http://i.imgur.com/viq3y.jpg'
+ alt:
+ 'ProGit book'
+ agile_book:
+ url: 'http://pragprog.com/book/rails3/agile-web-development-with-rails'
+ picture: 'http://imgur.com/fCaBt.jpg'
+ alt: 'Agile Web Development with Rails (3rd edition) book'
+
+ php_mysql_apache:
+ picture:
+ 'http://i.imgur.com/Xvmt1.jpg'
+ alt:
+ 'PHP5 Apache MySQL web development book'
+
+screencasts:
+ ruby_walktrought:
+ name: 'The Ruby 1.9 Walkthrough'
+ url: 'https://cooperpress.com/19walkthrough'
+ picture: 'https://cooperpress.com/images/promo.jpg'
+
+ youtube_mongo:
+ name: 'Introduction to MongoDB - Part III, MongoMapper & Rails'
+ url: 'http://www.youtube.com/watch?v=4HrBNucPYuM'
+ #picture: nil
+ alt: 'http://www.teachmetocode.com'
+
+ screencasts_org_sass2:
+ name: 'Introduction to Sass: Part 2'
+ url: 'http://screencasts.org/episodes/introduction-to-sass-part-2'
+ alt: 'at screencasts.org'
+
+ screencasts_org_sass1:
+ name: 'Introduction to Sass: Part 1'
+ url: 'http://screencasts.org/episodes/introduction-to-sass'
+ alt: 'at screencasts.org'
+
+ peepcode_haml_sass:
+ name: 'Peepcode Haml & Sass'
+ url: 'https://peepcode.com/products/haml-and-sass'
+ picture: 'https://peepcode.com/system/covers/haml-and-sass.png'
+ alt: 'Peepcon screencast on Haml, Sass'
+
+ peepcode_rayan_singer:
+ name: 'Play by Play: Ryan Singer (UI)'
+ url: 'https://peepcode.com/products/ryan-singer-ux'
+ picture: 'https://peepcode.com/system/covers/ryan-singer-ux.png'
+ alt: 'peepcode screencast on UI workflow '
+
+ peepcode_rspec_controller:
+ name: "RSpec controllers"
+ url: 'https://peepcode.com/products/rspec-controllers-and-tools'
+ picture: 'https://peepcode.com/system/covers/rspec-controllers-and-tools.png'
+
+ peepcode_rspec_model:
+ name: 'RSpec models'
+ url: 'https://peepcode.com/products/rspec-mocks-and-models'
+ picture: 'https://peepcode.com/system/covers/rspec-mocks-and-models.png'
+
+ peepcode_rspec_basics:
+ name: 'RSpec basics'
+ url: 'https://peepcode.com/products/rspec-basics'
+ pciture: 'https://peepcode.com/system/covers/rspec-basics.png'
+
+ peepcode_rspec_basics:
+ name: 'GIT'
+ url: 'https://peepcode.com/products/git'
+ picture: 'https://peepcode.com/system/covers/git.png'
+ alt: 'Peepcode on GIT'
+ pragprog_metaprograming:
+ name: 'The Ruby Object Model and Metaprogramming'
+ url: 'http://pragprog.com/screencasts/v-dtrubyom/the-ruby-object-model-and-metaprogramming'
+ picture: 'http://imagery.pragprog.com/products/122/v-dtrubyom_xlargecover.jpg'
+ alt: 'Realy good cast demostrating how are objects actually working '
+
+
+
+
+
View
72 wisdom_inside/scraps/microblog
@@ -1,3 +1,75 @@
+# current full url or full path in views and controllers
+
+~~~ruby
+ p request.fullpath
+ "/foo/2/histories"
+
+ p request.url
+ "http://localhost:3000/foo/2/histories"
+~~~
+
+(REFERENCE)[http://stackoverflow.com/questions/2165665/how-to-get-current-url-in-rails]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# access view/helper methods in controller
+
+
+~~~ruby
+class UsersController < ApplicationController
+ def destroy
+ #...
+ undo_link = view_context.link_to("undo", some_path)
+ falsh[:notice] = "bla bla #{undo_link}"
+ # ...
+ end
+end
+~~~
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# rails 3 partial render allias
+
+~~~ruby
+= render 'addresses/search_fields', :f=>f
+# is same (and shorter) than
+= render partial: 'addresses/search_fields', locals: {:f=>f}
+~~~
+
+
+
+
+
+
+
+
+
+
# passing block to partial
Please sign in to comment.
Something went wrong with that request. Please try again.