Skip to content

Instantly share code, notes, and snippets.

Avatar
🤖
Working at Resuelve

Alvaro Lizama alvarolizama

🤖
Working at Resuelve
View GitHub Profile
@alvarolizama
alvarolizama / application.ex
Created Oct 11, 2020 — forked from gvaughn/application.ex
Cowboy 2.5 proxy, used to bind a single port (on Heroku) for umbrella Phoenix applications. It supports HTTPS and websockets properly.
View application.ex
defmodule MasterProxy.Application do
alias MyApp.Endpoint, as: MyAppEndpoint
alias MyApp.UserSocket, as: MyAppUserSocket
alias MyOtherApp.Endpoint, as: MyOtherAppEndpoint
alias MyOtherApp.UserSocket, as: MyOtherAppUserSocket
alias Phoenix.LiveReloader.Socket, as: LiveReloadSocket
alias Plug.Cowboy
View gist:e02ed78ade0edf8e17d2046c317a7d91
(use-package multi-vterm
:ensure t
:config
(setq system-uses-terminfo nil
multi-term-program "/bin/zsh"
term-suppress-hard-newline t
multi-term-switch-after-close nil
term-char-mode-point-at-process-mark nil)
(add-hook 'term-mode-hook
(lambda ()
View init.el
(require 'package)
(when (>= emacs-major-version 26)
(require 'package)
(package-initialize)
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)
)
(setq package-check-signature nil)
View init.el
(require 'package)
(when (>= emacs-major-version 26)
(require 'package)
(package-initialize)
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)
)
(setq package-check-signature nil)
@alvarolizama
alvarolizama / gce_auth.ex
Created Jul 10, 2019 — forked from plamb/gce_auth.ex
Authenticate with Google Cloud using service account json key and Elixir
View gce_auth.ex
# https://developers.google.com/identity/protocols/OAuth2ServiceAccount
key_json = File.read!("some-service-account-key-file.json")
key_map = JOSE.decode(key_json)
jwk = JOSE.JWK.from_pem(key_map["private_key"])
jws = %{"alg" => "RS256"}
header = %{
View gist:e486b29d4bb27f0c5378b2524dfe54b1
### Keybase proof
I hereby claim:
* I am alvarolizama on github.
* I am alvarolizama (https://keybase.io/alvarolizama) on keybase.
* I have a public key ASAfmvhjRzu1qlAMvvJ53x9R4g0B0_G6240gUCRxRPB7AAo
To claim this, I am signing this object: