This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
=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') |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
Web fonts are pretty much all the rage. Using a CDN for font libraries, like TypeKit or Google Fonts, will be a great solution for many projects. For others, this is not an option. Especially when you are creating a custom icon library for your project.
Rails and the asset pipeline are great tools, but Rails has yet to get caught up in the custom web font craze.
As with all things Rails, there is more then one way to skin this cat. There is the recommended way, and then there are the other ways.
Here I will show how to update your Rails project so that you can use the asset pipeline appropriately and resource your files using the common Rails convention.
AWS_CONFIG = { | |
'access_key_id' => YOUR_ACCESS_KEY, | |
'secret_access_key' => YOUR_SECRET_ACCESS_KEY, | |
'bucket' => 'froala', | |
'acl' => 'public-read', | |
'key_start' => 'uploads/', | |
'region' => 's3' # For other regions than us-east-1, use s3-region. E.g.: s3-eu-west-1 | |
} |
gem 'rails_12factor'
to your Gemfile. This will add error logging and the ability for your app to serve static assets.bundle
RAILS_ENV=production rake db:create db:migrate db:seed
rake secret
and copy the outputexport SECRET_KEY_BASE=output-of-rake-secret
rake assets:precompile
. This will create a folder public/assets
that contains all of your assets.RAILS_ENV=production rails s
and you should see your app.Remember to clobber your assets (rake assets:clobber
) and re-precompile (rake assets:precompile
) if you make changes.
@testable import MyApp | |
import UIKit | |
import XCTest | |
class ViewControllerTests: XCTestCase { | |
var storyboard: UIStoryboard! | |
func storyboardName() -> String { | |
return "Main" | |
} |
Hi guys, So in episode 7 you were asking about where and how the puts
method connects to the computer’s display and writes the output. And in episode 8 you were asking about the times
method, how that worked and why it wasn’t implemented with YARV instructions. In both cases, I didn’t go into detail about this in the book because it would have distracted you from the topic at hand, which is how YARV executes your code. (Or in this case, my example Ruby code from the book.)
Both the puts
and times
methods were written by the Ruby code team, and not by you or me. Both of them are implemented in C code. So when you’re writing a Ruby program, some of the methods you write yourself, but you get many other methods for free because they are part of the Ruby language. Many of the these built in methods are part of the standard library, which means they are Ruby code written by the Ruby core team, while other built in methods are written directly in C code by the Ruby team.
As you know, the puts
method tak
class CreatePgSearchDocuments < ActiveRecord::Migration[6.0] | |
def self.up | |
create_table :pg_search_documents do |t| | |
t.text :content | |
t.string :searchable_type | |
t.uuid :searchable_id | |
t.tsvector :content_tsvector | |
t.timestamps null: false | |
end |