curl $(docker-machine ip default):3000
List containers:
sudo docker ps
Shell access to running container
sudo docker exec -it <container name> bash
Access psql
require "uri" | |
require "json" | |
require "net/http" | |
class Client | |
API_KEY = ENV['API_KEY'] | |
API_SECRET = ENV['API_SECRET'] | |
BASE_URL = 'https://api.coinbase.com' | |
BASE_PATH = '/api/v3/brokerage' | |
PRODUCT_ID = BotSettings::PRODUCT_ID |
API_KEY='<Your API Key>' | |
API_SECRET='<Your API Secret>' | |
HOST='https://api.sandbox.braveno.com' |
# frozen_string_literal: true | |
class Decider | |
def self.undecided | |
loop do | |
break if decision? | |
end | |
end | |
def self.decision? | |
# code yielding true or false |
# The immediate tendency is to go with a ternary, a la: | |
hash[:key].present? ? hash[:key] : 'default' | |
# To save a little on ABC complexity, I like `#presence`: | |
``` | |
>> h = { a: "I'm here" } | |
>> h[:a].presence || 'default' | |
"I'm here" |
#expand-collapse-all | |
= image_tag('expand_all.png', id: 'expand-all', onclick: 'showAll()') | |
= image_tag('collapse_all.png', id: 'collapse-all', onclick: 'hideAll()') | |
.things-to-hide-or-show |