This file contains 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
defmodule FPR do | |
@moduledoc """ | |
# FProf Reporter | |
Format results from `:fprof` into something human readable, with some basic | |
filtering and sorting options. | |
Start/Stop `:fprof` from IEx with the calls shown below (connect to your | |
running application idealy). |
This file contains 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
'use strict' | |
const DOMAIN = 'a.roguetrader.com' | |
const AUTHX_BASE = '/authx/v1/api' | |
const VALIDATION = {} // copy validation from your profile->APIKey page | |
const request = require('request') | |
const jwt = require('jsonwebtoken') | |
const uuid = require('uuid') | |
/* ********************************************************************** */ |
This file contains 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
defmodule Utils.Time do | |
import Utils.Types, only: [str_to_int!: 1, str_to_float: 1] | |
import Utils.Enum, only: [enum_rx: 2] | |
# note for future | |
# https://hexdocs.pm/nimble_parsec/NimbleParsec.html | |
def iso_time_range(input) when is_binary(input) do | |
case String.split(input, "/") do | |
[stime, etime] -> |
This file contains 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
kube-env() { | |
local env=$1 | |
local ns=${2:-apz} | |
[ ! $env ] && { | |
echo "KUBE_ENV =$KUBE_ENV" | |
echo "KUBE_NAMESPACE=$KUBE_NAMESPACE" | |
echo "Envs: p1 d1" | |
echo "Namespaces: (run kubectl get namespaces)" | |
return 0 |
This file contains 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
/* bring in configs, and backends, like db */ | |
/* const config = require('config') */ | |
let healthy = true | |
setInterval(() => { | |
// check db pools, maybe run a query, etc. | |
try { | |
if (db.check_health()) { // but do this with a timelimit that is less than check interval seconds | |
healthy = true |
This file contains 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
# When working on a project with multiple developers master will get ahead of your work. | |
# To come in sync should you rebase? merge? what is a fast-forward? Lots of discussion | |
# is available on this, here are a few: | |
# https://hackernoon.com/git-merge-vs-rebase-whats-the-diff-76413c117333 | |
# https://www.atlassian.com/git/tutorials/merging-vs-rebasing | |
# | |
# I prefer a merge/fast-forward, rather than rebase. These helpers assist in that process. | |
# LMK your thoughts and if you know of a better way! Enjoy! |