Skip to content

Instantly share code, notes, and snippets.

Yuri yurifrl

View GitHub Profile
View gist:522af97deabe5aec11c592d43ead1aff
### Keybase proof
I hereby claim:
* I am yurifrl on github.
* I am yurifrl (https://keybase.io/yurifrl) on keybase.
* I have a public key ASAj1fSRWTEmpQnIkhQ718jSx-coloQ-OVDjVePSck4nIAo
To claim this, I am signing this object:
@yurifrl
yurifrl / kong-ingres.yml
Created Nov 12, 2018
Drone With Kong when github error of url mistmatch
View kong-ingres.yml
apiVersion: configuration.konghq.com/v1
kind: KongIngress
metadata:
name: drone-drone
labels:
app: drone
component: server
release: drone
route:
preserve_host: true
View create-kms-secret.sh
#!/usr/bin/env sh
KEY=$1
VALUE=$2
INIT=$3
: "${KEYRING:=global}"
: "${LOCATION:=global}"
: "${SERVICE_ACCOUNT:?Variable not set or empty}"
gcloud () {
@yurifrl
yurifrl / gcloud
Last active Nov 13, 2018
gcloud cli
View gcloud
#!/usr/bin/env sh
docker run --rm \
-t $([[ -t 0 ]] && echo "-i") \
-w /workspace \
-v "$PWD:/workspace" \
-v /usr/bin/docker:/usr/bin/docker \
-v /var/run/docker.sock:/var/run/docker.sock \
-v kube-data:/root \
gcr.io/cloud-builders/gcloud "$@"
@yurifrl
yurifrl / package.json
Created Oct 31, 2018
Ava setup with babel tests with .test suporting async await for tests no for compiled code
View package.json
{
"name": "name",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"build": "babel src -d dist/ --ignore '**/*.test.js'",
"test": "ava",
"flow": "flow"
},
View gist:c2329d4107c60a7bba16c53605f80ddc
#### Issue description
#### Steps to reproduce the issue
1.
2.
3.
@yurifrl
yurifrl / kube-port-foward
Last active Oct 15, 2018
A bash script for kubectl port-foward, copy of https://github.com/johanhaleby/kubetail
View kube-port-foward
#!/bin/bash
readonly PROGNAME=$(basename $0)
default_since="10s"
default_namespace="default"
default_line_buffered=""
default_colored_output="pod"
line_buffered="${default_line_buffered}"
@yurifrl
yurifrl / normalizer.js
Last active Oct 17, 2018
ramda, convert properties of objet into snakeCase or camelCase
View normalizer.js
import { concat, zipObj, keys, values, map, isEmpty, curry } from 'ramda'
const log = curry(console.log)
const snakeCaseObj = [{
a_b: "asdasdasd",
c_a: "2018-02-20T18:43:17.104Z",
t_c: {
s_d: "2018-02-20",
e_d: "2018-02-20",
b_t: {
c_a: "2018-02-20T18:43:17.104Z"
@yurifrl
yurifrl / cheat-sheet.org
Last active Sep 18, 2017
Emacs Evil-Mode Cheat Sheet
View cheat-sheet.org

Emacs Evil-Mode Cheat Sheet

Workflow

  • Open emacs, Use terminal with tmux for shell things, use emacs to file processing

Base

  • `C-x`, `SPC` Shortcuts
  • `M-x`, `S-:` Commands
@yurifrl
yurifrl / chain.js
Last active Apr 12, 2017
Promise chaining
View chain.js
// TL;DR
// return arrays
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all
// http://stackoverflow.com/questions/28250680/how-do-i-access-previous-promise-results-in-a-then-chain
// http://stackoverflow.com/questions/22892681/what-patterns-are-there-for-passing-state-through-a-chain-of-promises-in-javascr
// http://bluebirdjs.com/docs/api/spread.html
// You design your api like aways, put when you want to pass a value, you pass Promise.all, and you do this in
// process of chaining it, your api, doesn't need to be awere of promises
You can’t perform that action at this time.