- Zero Downtime
- Graceful shutdowns
- Via Github Actions
- Zero infrastructure management overhead
The general idea is to have Github Actions test, build and deploy a Rails app to Google Cloud Compute Engine.
/* | |
* Copyright 2020 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
;; declare it here for Emacs < 28 | |
(defmacro dlet (binders &rest body) | |
"Like `let' but using dynamic scoping." | |
(declare (indent 1) (debug let)) | |
;; (defvar FOO) only affects the current scope, but in order for | |
;; this not to affect code after the main `let' we need to create a new scope, | |
;; which is what the surrounding `let' is for. | |
;; FIXME: (let () ...) currently doesn't actually create a new scope, | |
;; which is why we use (let (_) ...). | |
`(let (_) |
(defface tree-sitter-hl-face:warning | |
'((default :inherit font-lock-warning-face)) | |
"Face for parser errors" | |
:group 'tree-sitter-hl-faces) | |
(defun hook/tree-sitter-common () | |
(unless font-lock-defaults | |
(setq font-lock-defaults '(nil))) | |
(setq tree-sitter-hl-use-font-lock-keywords nil) | |
(tree-sitter-mode +1) |
ARG ALPINE_VERSION=3.12.0 | |
FROM hexpm/elixir:1.11.0-erlang-23.1.1-alpine-3.12.0 as builder | |
ARG APP_VSN="1.0.0" | |
# Replace `your_app` with your otp application name. | |
ENV APP_NAME=your_app \ | |
APP_VSN=${APP_VSN} \ | |
MIX_ENV=prod |
# Overrides Rails file activerecord/lib/active_record/schema_dumper.rb to | |
# include all schema information in the db/schema.rb file, for example, in the | |
# create_table statements. This allows for a working development database | |
# to be built from a schema.rb file generated by rake db:schema:dump. | |
# | |
# This is essentially a rebuild of the "schema_plus_multischema" gem (which is | |
# unfortunately only compatible with Rails ~> 4.2). | |
# | |
# Tested with Rails 6.0. |
An animated cheatsheet for smartparens using the example configuration specified here by the smartparens author. Inspired by this tutorial for paredit.
C-M-f | sp-forward-sexp |
C-M-b | sp-backward-sexp |
#!/bin/bash | |
# ** Vars | |
# *** Emacs version | |
if type emacs26 &>/dev/null | |
then | |
emacs="emacs26" | |
emacsclient="emacsclient26" | |
emacsWindowClass="Emacs" |
require 'keyword_struct' | |
Mobiledoc = KeywordStruct.new(:version, :markups, :atoms, :cards, :sections) do | |
Markup = Struct.new(:tag, :attrs) | |
Atom = Struct.new(:name, :text, :payload) | |
Card = Struct.new(:name, :payload) | |
# Parses a serialized Mobiledoc into a collection of Ruby objects | |
def self.parse(str) | |
json = JSON.parse(str) |