ansible-galaxy install -p roles geerlingguy.docker
ansible-playbook site.yml
chmod +x deploy.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[defaults] | |
inventory = hosts | |
pipelining = True | |
timeout = 30 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main exposing (..) | |
import Browser | |
import Html exposing (Html, button, div, text) | |
import Html.Events exposing (onClick) | |
import Random | |
main : Program () Model Msg | |
main = | |
Browser.element { init = \_ -> init, update = update, view = view, subscriptions = \_ -> Sub.none } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:1.13.4-alpine3.10 as build | |
RUN apk add --update git | |
WORKDIR /app | |
COPY go.mod go.sum /app/ | |
RUN go mod download | |
COPY . . | |
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags '-w -extldflags "-static"' -o app . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM fpco/stack-build:lts-14.20 as build | |
WORKDIR /app | |
COPY .init-stack.yaml stack.yaml | |
COPY .init-stack.yaml.lock stack.yaml.lock | |
COPY .init-package.yaml package.yaml | |
RUN stack build --only-dependencies | |
COPY . . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
job "consul-exporter" { | |
datacenters = ["dc1"] | |
group "consul-exporter" { | |
task "consul-exporter" { | |
driver = "exec" | |
artifact { | |
source = "https://github.com/prometheus/consul_exporter/releases/download/v0.4.0/consul_exporter-0.4.0.linux-amd64.tar.gz" | |
options { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vars: | |
version: "{{ ansible_date_time.epoch }}" | |
backend_container_name: "backend-{{ version }}" | |
tasks: | |
- name: Run backend container | |
docker_container: | |
<<: *base-app | |
name: "{{ backend_container_name }}" | |
command: bundle exec puma -C config/puma.rb -t 1:3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetch = require('node-fetch'); | |
const MoyskladCore = require('moysklad'); | |
const MoyskladQueueExtension = require('moysklad-extension-queue'); | |
const { loadRows } = require('moysklad-tools'); | |
const { readFileSync } = require('fs'); | |
const Moysklad = MoyskladCore.compose(MoyskladQueueExtension); | |
const ms = Moysklad({ | |
queue: true, | |
fetch, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'arbre' | |
require 'benchmark' | |
def generate_html | |
context = Arbre::Context.new do | |
100000.times do |i| | |
div class: 'article' do | |
div "Article #{i}", class: 'article__title' | |
div "Awesome content", class: 'article__content' | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Redis | |
class Client | |
class Connector | |
class Sentinel | |
def sentinel_detect | |
@sentinels.each do |sentinel| | |
client = Client.new(@options.merge({ | |
:host => sentinel[:host], | |
:port => sentinel[:port], | |
:password => sentinel[:password], # patch! |