Go to the official website and choose your OS.
Docker for Mac has a problem is the disk IO performance (see docker/for-mac#77).
There is a fix (https://github.com/IFSight/d4m-nfs) which makes Docker use NFS instead of OSXFS.
# Simple, scrappy UDP DNS server in Ruby (with protocol annotations) | |
# By Peter Cooper | |
# | |
# MIT license | |
# | |
# * Not advised to use in your production environment! ;-) | |
# * Requires Ruby 1.9 | |
# * Supports A and CNAME records | |
# * See http://www.ietf.org/rfc/rfc1035.txt for protocol guidance | |
# * All records get the same TTL |
require 'objspace' | |
def self.show_allocations(&block) | |
_ = ObjectSpace.trace_object_allocations &block | |
ObjectSpace | |
.each_object | |
.to_a | |
.filter_map do |obj| | |
file = ObjectSpace.allocation_sourcefile obj | |
line = ObjectSpace.allocation_sourceline obj |
# https://twitter.com/josh_cheek/status/1587406334839889921 | |
$**?$ # => "" | |
$**%$*$ # => "" | |
$**%** # => "" | |
$**%$$ # => "" | |
$_ = {} | |
alias $*$_ | |
public def *(*) = itself | |
alias ** * |
Because I couldn't find these with a quick Google search on 28 April 2015: | |
Usage: | |
rails new APP_PATH [options] | |
Options: | |
-r, [--ruby=PATH] # Path to the Ruby binary of your choice | |
# Default: /home/brian/.rvm/rubies/ruby-2.2.0/bin/ruby | |
-m, [--template=TEMPLATE] # Path to some application template (can be a filesystem path or URL) | |
[--skip-gemfile], [--no-skip-gemfile] # Don't create a Gemfile |
components/ | |
my_bounded_context/ | |
app/ | |
presentation/ # This is called the "UI" layer in DDD literature, but it is also | |
# where things like JSON interfaces live -- any kind of presentation | |
# or handshake to anything outside. So "presentation" rather than "ui". | |
assets/ | |
helpers/ | |
mailers/ | |
views/ |
require 'active_record' | |
ActiveRecord::Base.logger = Logger.new(STDERR) | |
ActiveRecord::Base.colorize_logging = false | |
ActiveRecord::Base.establish_connection( | |
:adapter => "sqlite3", | |
:dbfile => ":memory:" | |
) |
=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') |
module BinaryTree | |
class Node | |
attr_reader :word, :count, :left, :right | |
include Enumerable | |
def initialize(word) | |
@word, @count = word, 1 | |
end |
Go to the official website and choose your OS.
Docker for Mac has a problem is the disk IO performance (see docker/for-mac#77).
There is a fix (https://github.com/IFSight/d4m-nfs) which makes Docker use NFS instead of OSXFS.
This example will show how to push updates to the view for a Model instance that has changed without the user having to refresh the page.
This example focuses more on getting ActionCable working with Stimulus. If you don't already have stimulus setup in your app, here's a great write up on how to set it up: https://medium.com/better-programming/how-to-add-stimulus-js-to-a-rails-6-application-4201837785f9
Scan
model with attributes.ScanController#show
action.Scan
through the show.html.slim|haml|erb
view template.