Skip to content

Instantly share code, notes, and snippets.

gone fishing

Evadne Wu evadne

gone fishing
Block or report user

Report or block evadne

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
evadne / gettext-sanitise.exs
Created Oct 13, 2019
Sanitise Gettext (Elixir) output for version control
View gettext-sanitise.exs
# For all .POT files
# Parse PO to internal format
# Remove comments
# Remove duplicate references
# Sort terms by key
# Dump out data
# Bodge data with regex
# Remove leading #: for long reference
# Write file
evadne / service_discovery.ex
Created Sep 12, 2019
ExAws add-on for AWS Service Discovery
View service_discovery.ex
defmodule ExAws.ServiceDiscovery do
@moduledoc """
Minimal module to issue AWS Cloud Map requests with ExAws, which
is used by clustering mechanisms.
alias ExAws.Operation.JSON
@version "2017-03-14"
@namespace "Route53AutoNaming_v20170314"
evadne /
Created Apr 28, 2019
Properly invoke Sublime Text from WSL
function subl () {
SublimePath="/mnt/c/Program Files/Sublime Text 3/subl.exe"
TargetPath=$(readlink -f $1)
ProjectsPath=$(readlink -f $HomePath/projects)
SublimeProjectsPath=$(readlink -f $HomePath/sublime)
echo "Editing $TargetPath"
case $TargetPath/ in
View .gitignore
evadne /
Last active Feb 6, 2019
Build & Cache multi-stage Docker images (with Build Specification for AWS CodeBuild)
# the general idea
Stages=$(cat $FilePath | grep -oP '^FROM .+ (AS|as) \K(.+)$')
CacheArgs=$(for Stage in $Stages; do echo "--cache-from $RepoURI:cache-$Stage"; done | paste -sd ' ')
BuildArgs="--file $FilePath $CacheArgs"
for Stage in $Stages; do docker pull $RepoURI:cache-$Stage || true; done
for Stage in $Stages; do docker build $BuildArgs --tag $RepoURI:cache-$Stage --target $Stage . || break; done
docker build $BuildArgs --tag $RepoURI:$ImageTag .
evadne / gist:440558b18228ca657ef22b465793a0c3
Last active Nov 27, 2018
Using SchemaCrawler on PostgreSQL databases
View gist:440558b18228ca657ef22b465793a0c3
evadne / srcds_rcon.ex
Created Nov 12, 2018
Source RCON client in Elixir (using gen_tcp)
View srcds_rcon.ex
defmodule HuddleGateway.External.SourceRemoteControl do
@moduledoc """
A simple gen_tcp based implementation of a Source RCON client
- [Source RCON Protocol](
By calling `connect/2`, you can obtain an open TCP socket,
which can then be used with `auth/3` or `exec/3`.
evadne / environment.ex
Created Nov 11, 2018
Environment Variable based Config Provider
View environment.ex
defmodule Huddle.Environment do
use GenServer
@config_entries [
{:huddle_web, HuddleWeb.Endpoint, ~w(http port)a, {:system, "PORT"}}
def start_link(args) do
GenServer.start_link(__MODULE__, args)
evadne / xmastree.ex
Last active Dec 16, 2019
Christmas Trees in Elixir
View xmastree.ex
defmodule Tree do
def print(n) do
for i <- 1 .. n do
p(n - i, " ")
p(i * 2 - 1, "*")
p(n - 1, " ")
#!/usr/bin/env bash
export AWS_PROFILE=<snip>
ImageDescription="Amazon Linux AMI 2017.09.1.20180115"
RegionNames=$(aws ec2 describe-regions --region eu-west-1 --query 'Regions[*].[RegionName]' --output text)
function getImages () {
You can’t perform that action at this time.