Skip to content

Instantly share code, notes, and snippets.

View darkslategrey's full-sized avatar

Grégory Faruch darkslategrey

View GitHub Profile
echo 'B=inside .env' > .env && \
echo -e "require 'dotenv'; Dotenv.load; task :t do\n puts ENV['B']\nend" > Rakefile && \
export B=exported_b && \
rake t && \
echo -e "\n===\n" && \
unset B && \
rake t
require 'dotenv'
Dotenv.load
task :t do
puts ENV['B']
end
Generated postgrex app
==> eventstore
Compiling 49 files (.ex)
== Compilation error in file lib/event_store/storage/reader.ex ==
** (CompileError) lib/event_store/storage/reader.ex:73: Postgrex.Timestamp.__struct__/0 is undefined, cannot expand struct Postgrex.Timestamp
lib/event_store/storage/reader.ex:73: (module)
could not compile dependency :eventstore, "mix compile" failed. You can recompile this dependency with "mix deps.compile eventstore", update it with "mix deps.update eventstore" or clean it with "mix deps.clean eventstore"
@darkslategrey
darkslategrey / gc
Created July 13, 2018 08:47 — forked from scjody/gc
"gcloud config" wrapper to easily select the correct configuration
#!/bin/bash
if [[ -z "$1" ]]; then
gcloud config configurations list;
else
case "$1" in
# These clauses implement aliases for my most commonly used configurations.
# Change them to support your needs or remove them.
prod)
gcloud config configurations activate default
@darkslategrey
darkslategrey / tramp-gcloud-ssh
Created July 13, 2018 08:46 — forked from scjody/tramp-gcloud-ssh
EMACS TRAMP setup for "gcloud compute ssh"
;; TRAMP gcloud ssh
(add-to-list 'tramp-methods
'("gssh"
(tramp-login-program "gssh")
(tramp-login-args (("%h")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
(tramp-remote-shell-args ("-c"))
(tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
("-o" "UserKnownHostsFile=/dev/null")
We couldn’t find that file to show.
checkNewVersion = false
IdleTimeout = "180s"
MaxIdleConnsPerHost = 500
logLevel = "DEBUG"
# defaultEntryPoints = ["http"]
[retry]
attempts = 3
[web]
@darkslategrey
darkslategrey / redis-job.nomad
Created June 20, 2018 16:27
redis-job.nomad
job "redis" {
datacenters = ["europe-west1-b", "europe-west1-c", "europe-west1-d"]
# datacenters = ["dc1"]
type = "service"
update {
max_parallel = 1
min_healthy_time = "10s"
healthy_deadline = "3m"
canary = 0
@darkslategrey
darkslategrey / docker.md
Created May 21, 2018 19:13 — forked from f3l1x/aliases
Docker - installation, tips, commands, aliases

Docker

Shortcuts

$ curl -fsSL https://raw.github.com/tcnksm/docker-alias/master/zshrc >> ~/.bashrc && source ~/.bashrc
# ------------------------------------