Docker host is reachable through the address of the Docker bridge, which happens to be the default gateway for the container.
From the host:
From the container:
#!/bin/sh
Link to article about the directory structure using groups
This is the source for the scripts discussed in https://robots.thoughtbot.com/improving-user-experience-with-shell-scripts
Both scripts are in the bin/
directory of the repo that contains all the markdown documents for blog posts.
Users run bin/server
and everything is automatically set up for them to view a local preview of the blog.
bin/server-setup
is a dependency of bin/server
and is never run directly by users.
Maitre-d is the name of the "blog engine" discussed in the article.
#!/usr/bin/env ruby | |
#/ Usage: <progname> [options]... | |
#/ How does this script make my life easier? | |
# ** Tip: use #/ lines to define the --help usage message. | |
$stderr.sync = true | |
require 'optparse' | |
# default options | |
flag = false | |
option = "default value" |
module GitHub | |
module CSP | |
# Public: Constants for CSP keywords | |
NONE = "'none'".freeze | |
SELF = "'self'".freeze | |
UNSAFE_INLINE = "'unsafe-inline'".freeze | |
UNSAFE_EVAL = "'unsafe-eval'".freeze | |
# Public: Constants for CSP directive names | |
BASE_URI = "base-uri".freeze |
config.middleware.insert_before 0, "Rack::Cors", debug: true, logger: ->{Rails.logger} do | |
allow do | |
origins 'localhost:3000' | |
resource %r{/users\/?\d*}, | |
:headers => ['Origin', 'Accept', 'Content-Type','Token'], | |
:methods => [:get, :put, :delete], | |
:max_age => 0 | |
end | |
end |
import { Component } from "React"; | |
export var Enhance = ComposedComponent => class extends Component { | |
constructor() { | |
this.state = { data: null }; | |
} | |
componentDidMount() { | |
this.setState({ data: 'Hello' }); | |
} | |
render() { |
class Importer | |
def parse_csv_file(csv_file) | |
File.open(csv_file) do |file| | |
ActiveRecordModel.transaction do | |
import_csv_stream(file) | |
end | |
end | |
end | |
end |