JavaScript でクリックのイベント処理とか GET 以外ならトークンを含めるとか全部やらないといけないから面倒くさい
<a href="/some_action" class="some-action">some action</a>
=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') |
ja: | |
errors: | |
messages: | |
not_found: "は見つかりませんでした" | |
# not_found: "not found" | |
already_confirmed: "は既に登録済みです" | |
# already_confirmed: "was already confirmed" | |
not_locked: "は凍結されていません" | |
# not_locked: "was not locked" |
me:
Is it possible to send a signal to a worker/process?
I realize the platform sends SIGTERM
and SIGKILL
when restarting a dyno, but I need to send a USR1
to one of my workers to tell it to stop picking up new jobs. Normally this is achieved via kill -USR1 <pid>
, but on the Heroku platform not only do we not know know the pid, we also don't run one-off commands on the same dyno.
Caio (heroku support):
We had this feature experimentally at some point but it was never productized. I recommend you find other ways to signal your processes, like setting a database flag.
me:
A not politically correct assertion of my feelings towards a piece of software:
Note: Repetition builds cynicism, asset_sync
isn't bad, but when an asset problem cannot be solved via support it gets escalated to me. Often times someone using asset_sync
the problem is due to their use of the library and not from Heroku.
The asset sync gem uploads your assets (images, css, javascript) to S3. From there you can either point browsers to the copy on S3 or use a CDN + the S3 bucket. It's a good idea, and solved a problem at one time.
It is no longer needed and you should now use https://devcenter.heroku.com/articles/using-amazon-cloudfront-cdn instead. So rather than copying your assets over to S3 after they are precompiled the CDN grabs them from your website instead. Here's some reasons why it's better.
Why not set backlog on Heroku?
First read this: https://mikecoutermarsh.com/adjusting-pumas-backlog-for-heroku/
Now we're on the same page. Heroku will re-route bounced requests from your dynos but it assumes when this happens that your entire app is saturated. https://devcenter.heroku.com/articles/http-routing#dyno-connection-behavior. Each connection gets delayed by 5 seconds, so you're automatically being docked 5 seconds per request.
If you're setting your backlog to a low value (i.e. if you'll ever actually ever hit backlog) then you'll be in for pain. When you get a spike of requests from slashdot/reddit/whatever you're telling your dynos that you would rather they failed then returned slow responses. So this does mean that some requests will be served, but all the others will fail.
If your app ever hits your backlog (no matter what value it is) it is an indicator you don't have enough throughput and you need to scale out to more dynos. If you set this to an arbitrarilly low value, that point comes
(NOTE: Current and future versions of this and any other Advantage 2-related things I post will be at https://github.com/nicholasknight/adv2keyboard)
I received my Advantage 2 today. There's no full manual yet, even though keyboards are apparently arriving (hint, hint, Kinesis). The quick start guide leaves out the "power user mode", and there are some other quirks.
Update: A manual has been posted at http://www.kinesis-ergo.com/advantage2-resources/
It includes a dictionary for the key maps, but I know it leaves at least one possible key undocumented: it does not list f14
, but I have successfully mapped my scrollock to f14
regardless.
It also mentions a firmware version (1.0.18) that doesn't seem to be available yet, with a new feature (status report playback speed).
<%= form_for(@sundae) do |f| %> | |
<!-- | |
collection_check_boxes requires 4 parameters, the last two are methods that access | |
the value and text from the collection, respectively. Hence the need for | |
SundaesHelper.valid_flavors! | |
--> | |
<%= f.collection_check_boxes(:flavor_list, valid_flavors, :first, :first) do |b| %> | |
<!-- FYI: I use Bootstrap 4, so I customized how the checkboxes would render --> | |
<div class="form-check"> | |
<label class="form-check-label"><%= b.check_box class: 'form-check-input' %> <%= b.value %></label> |