=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') |
class StoredProcedureService | |
def self.instance | |
@instance ||= StoredProcedureService.new | |
end | |
def execute(name, *args) | |
results = [] | |
begin | |
connection.execute("CALL #{name}(#{args.join(',')})").each(as: :hash, symbolize_keys: true) do |row| |
【General Questions】 | |
1. What did you learn yesterday/this week? | |
2. What excites or interests you about coding? | |
3. What UI, Security, Performance, SEO, Maintainability or Technology considerations do you make while building a web application or site? | |
4. Talk about your preferred development environment. (OS, Editor, Browsers, Tools etc.) |
04/26/2103. From a lecture by Professor John Ousterhout at Stanford, class CS142.
This is my most touchy-feely thought for the weekend. Here’s the basic idea: It’s really hard to build relationships that last for a long time. If you haven’t discovered this, you will discover this sooner or later. And it's hard both for personal relationships and for business relationships. And to me, it's pretty amazing that two people can stay married for 25 years without killing each other.
[Laughter]
> But honestly, most professional relationships don't last anywhere near that long. The best bands always seem to break up after 2 or 3 years. And business partnerships fall apart, and there's all these problems in these relationships that just don't last. So, why is that? Well, in my view, it’s relationships don't fail because there some single catastrophic event to destroy them, although often there is a single catastrophic event around the the end of the relation
{ | |
// Taken from Visual Studio Code Defaults | |
// Enable / disable JavaScript validation | |
"javascript.validate.enable": true, | |
| |
// Defines space handling after a comma delimiter | |
"javascript.format.insertSpaceAfterCommaDelimiter": true, | |
| |
// Defines space handling after a semicolon in a for statement | |
"javascript.format.insertSpaceAfterSemicolonInForStatements": true, |
class Cosine | |
def initialize vecA, vecB | |
@vecA = vecA | |
@vecB = vecB | |
end | |
def calculate_similarity | |
return nil unless @vecA.is_a? Array | |
return nil unless @vecB.is_a? Array | |
return nil if @vecA.size != @vecB.size |
$ echo 'gem "webpacker"' >> Gemfile
$ bundle install
$ rails webpacker:install
$ yarn add [email protected] jquery popper.js
diff --git a/config/webpack/environment.js b/config/webpack/environment.js
index d16d9af..86bf1a7 100644
/**************************\ | |
Basic Modal Styles | |
\**************************/ | |
.modal { | |
font-family: -apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica neue,helvetica,ubuntu,roboto,noto,segoe ui,arial,sans-serif; | |
} | |
.modal__overlay { | |
position: fixed; |
This gist will collects all issues we solved with Rails 5.2 and Webpacker
# Last few parameters(--skip-* part) is only my habbit not actully required
$ rails new <project_name> --webpack=stimulus --database=postgresql --skip-coffee --skip-test