start new:
tmux
start new with session name:
tmux new -s myname
| # SSL self signed localhost for rails start to finish, no red warnings. | |
| # 1) Create your private key (any password will do, we remove it below) | |
| $ openssl genrsa -des3 -out server.orig.key 2048 | |
| # 2) Remove the password | |
| $ openssl rsa -in server.orig.key -out server.key |
| # install and make run basic bootstrap date-picker functionality described here http://www.eyecon.ro/bootstrap-datepicker/ | |
| # app/assets/javascript/datepicker.js.coffee | |
| $(document).on 'pageChanged', -> | |
| # datepicker for simple_form & Ransack | |
| $(".custom_datepicker_selector").datepicker().on 'changeDate', (en) -> | |
| correct_format = en.date.getFullYear() + '-' + ('0' + (en.date.getMonth() + 1)).slice(-2) + '-' + ('0' + en.date.getDate()).slice(-2) # date format yyyy-mm-dd | |
| $(this).parent().find("input[type=hidden]").val(correct_format) |
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
For a while, I have felt that the following is the correct way to improve the mass assignment problem without increasing the burden on new users. Now that the problem with the Rails default has been brought up again, it's a good time to revisit it.
When creating a form with form_for, include a signed token including all of the fields that were created at form creation time. Only these fields are allowed.
To allow new known fields to be added via JS, we could add:
| !!! 5 | |
| %html | |
| %head | |
| %title= "Your Website" | |
| %meta{ :content => "", :name => "description" } | |
| %meta{ :content => "", :name => "author" } | |
| %meta{ :content => "3 days", :name => "revisit-after" } | |
| %link{ :href => "http://creativecommons.org/licenses/by/3.0/", :rel => "license", :title => "Creative Commons Attribution 3.0 Unported License" } | |
| %link{ :href => "/feed", :rel => "alternate", :title => "Atom", :type => "application/atom+xml" } | |
| %link{ :href => "/css/screen.css", :media => "screen", :rel => "stylesheet" } |
| =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') |