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
services: | |
postgres: | |
container_name: postgres | |
# Custom postgres image contains the migration SQL needed to build the schema | |
image: custom-postgres:latest | |
environment: | |
PGUSER: foobar | |
POSTGRES_PASSWORD: foobar | |
POSTGRES_USER: foobar | |
POSTGRES_DB: foobar |
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
# Linux tmux is used as a session manager to persist processes started from a SSH connection (which are killed | |
# by default on disconnect). | |
# Start a tmux session, then a daemon process and exit the session (which keeps the daemon running): | |
# ssh -i <foobar>.pem <ip-address>:22 | |
tmux | |
# start a process with <cmd &> to start a daemon | |
Ctrl+B and then D # to exit the session |
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
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build ... |
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
package main | |
import ( | |
"fmt" | |
"sort" | |
) | |
type LinkedNode struct { | |
Val int | |
Next *LinkedNode |
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 'rack/protection' | |
require_relative './cors_handler' | |
# require_relative './api' | |
# Add any required ENV vars to this array | |
def env_vars_present? | |
[ | |
"RACK_ENV", | |
"PORT", | |
"CLIENT_ORIGIN" |
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
# Records events for a given key e.g. ShareID in the form of: | |
# | |
# { | |
# key1: [timestamp1, timestamp2], | |
# key2: [timestamp3, timestamp4] | |
# } | |
# | |
# Then tells you when a given threshold/limit has been exceeded. | |
# Starts a background thread to evict events when their TTL expires. |
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
#!/bin/bash | |
WEBHOOK_YAML_FILE="./path_to_webhook_yaml" | |
WEBHOOK_KEY="TODO_SET_CA_BUNDLE" | |
echo "Generating base64 encoded myCA.pem and setting in webhook YAML" | |
# Check $WEBHOOK_YAML_FILE file exists | |
if [ ! -e $WEBHOOK_YAML_FILE ]; then | |
echo "Unable to find ${WEBHOOK_YAML_FILE} file, has it been moved or renamed?" |
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
def multiple_of?(multiple : Int32, i : Int32) : Bool | |
(i % multiple) == 0 | |
end | |
def get_fizz_buzz_str(i : Int32) : String | |
if multiple_of?(3, i) && multiple_of?(5, i) | |
"FizzBuzz" | |
elsif multiple_of?(3, i) | |
"Fizz" | |
elsif multiple_of?(5, i) |
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
package main | |
import ( | |
"context" | |
"fmt" | |
"time" | |
) | |
func main() { | |
ctx := context.Background() |
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 "wgit" | |
# Remove the default extractors since we won't be using them. | |
Wgit::Document.remove_extractors | |
# The default name of the output file containing the clean HTML. | |
def default_file_name | |
"webpage.html" | |
end |
NewerOlder