Skip to content

Instantly share code, notes, and snippets.

View veverkap's full-sized avatar

Patrick Veverka veverkap

View GitHub Profile
@veverkap
veverkap / railsnew7.md
Created December 11, 2021 18:59
Rails New Output for Rails 7.0.0.rc1

Rails new on 7.0.0.rc1

Usage:
  rails new APP_PATH [options]

Options:
      [--skip-namespace], [--no-skip-namespace]              # Skip namespace (affects only isolated engines)
      [--skip-collision-check], [--no-skip-collision-check]  # Skip collision check
  -r, [--ruby=PATH]                                          # Path to the Ruby binary of your choice
                                                             # Default: /Users/patrickveverka/.rbenv/versions/2.7.1/bin/ruby
BEGIN MESSAGE.
vocJD2yH9c6V5so KQvrS5ALzkbfSSc S9OoLria02CTWC8 fv356voR2XuefSk
rdGmufcz1fTnGOo 4pfIqd7MZAkTCKq 6Xr2MZHgg4XRh36 O4CWOZgaHV823l5
etbsOmlRnPQ47MH JDgNOnLTFivaPLj nb6y2Z1wLPmVNFD a5Ecz3qBUNE8DCk
J1ZYNw8WLQklPR4 yp3jwQBxTwDkXhx u9uxp0Qz5Z.
END MESSAGE.
FROM ruby:2.6
RUN apt install ffmpeg
# throw errors if Gemfile has been modified since Gemfile.lock
RUN bundle config --global frozen 1
WORKDIR /usr/src/app
COPY Gemfile Gemfile.lock ./
terraform {
backend "remote" {
hostname = var.tfc_hostname
organization = var.tfc_organization
workspaces {
name = var.tfc_workspace
}
}
}
- name: setup servers
hosts: all
gather_facts: true
remote_user: pi
become: yes
become_user: root
roles:
- { role: utils, tags: ["utils"] }
- {
role: geerlingguy.docker_arm,
job "dockerregistry" {
datacenters = ["alpha"]
type = "service"
group "dockerregistry" {
# I only want one of these running at a time
count = 1
task "dockerregistry" {
# gotta use the docker driver
defmodule Tester do
def run(input) do
with {:ok, widget} <- process_widget(input) do
do_something_with_widget(widget) #noop
else
{:error, reason} ->
#something with reason
end
@spec process_widget(input :: binary) :: {:ok, contents :: binary} | {:error, reason :: binary}
defmodule SetGithubEvents do
import Plug.Conn
def init(opts), do: opts
def call(conn, _) do
event = List.keyfind(conn.req_headers, signature_header(), 0)
conn
|> handle_event(event)
@veverkap
veverkap / github_header.ex
Created July 5, 2018 19:50
github_header.ex
defmodule VerifyGithubSignature do
@behaviour Plug.Parsers
import Plug.Conn
def init(opts) do
opts
end
def parse(conn, "application", subtype, _headers, opts) do
signature = List.keyfind(conn.req_headers, signature_header(), 0)
defmodule Flatten do
@moduledoc """
Documentation for Flatten.
"""
@doc """
Flattens an arbitrarily sized list
## Examples