Note: Don't do this on a production evniroment!
Get the heroku database name:
heroku pg:info
Name can be found in the reponse from the command above. For example: Add-on: soaring-newly-1337
.
Note: Don't do this on a production evniroment!
Get the heroku database name:
heroku pg:info
Name can be found in the reponse from the command above. For example: Add-on: soaring-newly-1337
.
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
class ApplicationController < ActionController::Base | |
# Creates an accessor which is exposed to the view | |
def self.view_accessor(*names) | |
attr_accessor *names | |
helper_method *names | |
end | |
end |
Write a system that evolves a 100 x 100 grid of cells | |
to the next generation according to the following rules. | |
1) Any living cell with less than 2 live neighbors dies | |
2) Any living cell with 2 or 3 live neighbors stays alive | |
3) Any living cell with more than 3 live neighbors dies | |
4) Any dead cell with exactly 3 lives neighbors comes to life | |
Note: A cell has 8 neighbors | |
... |
*credit to Roy Osherove http://osherove.com/tdd-kata-1/ * | |
1, Create a simple String calculator with a function #add | |
- The method can take 0, 1 or 2 numbers and will return their sum (for an empty string, it will return 0) for example "" or "1" or "1,2" | |
- Start with the simplest test case of an empty string and move to 1 and 2 numbers | |
- Remember to solve things as simple as possible so that you force yourself to write tests you did not think about | |
- Remember to refactor after EACH passing test | |
Example Rails app | |
https://github.com/collinschaafsma/loyd | |
Example Sinatra app | |
https://github.com/collinschaafsma/slimfit | |
Awesome talk by Uncle Bob. | |
http://confreaks.com/videos/759-rubymidwest2011-keynote-architecture-the-lost-years | |
Clean Code Book |
/* function to urlify a string */ | |
var urlify = function(a){return a.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "-").replace(/^-+|-+$/g, '')}; | |
/* usage example */ | |
var str_a = "* The Best Wallpaper Magazine in the . ? & world! : Rjer9238131 & "; | |
urlify(str_a) | |
/* returns */ | |
"the-best-wallpaper-magazine-in-the-world-rjer9238131" |
Corey Haines gave his Fast Tests talk at the Golden Gate Ruby Conference 2011 (http://confreaks.net/videos/641-gogaruco2011-fast-rails-tests), here's my feedback on it.
So first up, I think it's very interesting to see another take on how to speed up Rails testing. There's been a focus on it for a couple of years now with various solutions coming for it. From running tests in parallel, to tweaking the filesystem for faster access. Corey Haines take on it is that we should isolate ourselves from the framework that Rails provides and do as much as possible in plain Ruby objects and modules. In his talk he shows how he has been able to massively improve the runtime of his tests by implementing this.
I think it is a logical next step to the current that has been in the community for a while where we have been debating how to improve the design of Rails applications.
require 'webrat' | |
require 'webrat/mechanize' | |
include Webrat::Methods | |
include Webrat::Matchers | |
Webrat.configure do |config| | |
config.mode = :mechanize | |
end |