Skip to content

Instantly share code, notes, and snippets.

@yurifrl
yurifrl / test.sh
Last active October 26, 2023 15:58
Testing build nix derivations, passing arguments to nix-buld
# https://nix-dev.science.uu.narkive.com/gkWG24xs/error-cannot-auto-call-a-function-that-has-an-argument-without-a-default-value-stdenv
nix-build --no-out-link -E 'with import <nixpkgs> {}; callPackage ./default.nix {}'
# the --no-out-link will no create the @result link
@yurifrl
yurifrl / cheat-sheet.org
Last active January 25, 2023 21:48
Emacs Evil-Mode Cheat Sheet

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 / normalizer.js
Last active June 2, 2022 10:46
ramda, convert properties of objet into snakeCase or camelCase
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"
#!/bin/bash
# curl -s -L https://gist.githubusercontent.com/yurifrl/277f79904c78876c1786069cd67be7a6/raw/33b94b7099456560aeae46fcbaaef95abec88a2b/deploy-istio.sh | bash -
cd /root/
/usr/bin/launch.sh>&2
ISTIO_VERSION=1.0.0
if [[ ! -d "/root/istio-$ISTIO_VERSION" ]]; then
echo "Downloading Istio... this may take a couple of moments">&2
curl -s -L https://git.io/getLatestIstio | ISTIO_VERSION=1.0.0 sh -
echo "Download completed. Configuring Kubernetes.">&2
else
### 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 / gcloud
Last active November 13, 2018 20:22
gcloud cli
#!/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 / kong-ingres.yml
Created November 12, 2018 11:40
Drone With Kong when github error of url mistmatch
apiVersion: configuration.konghq.com/v1
kind: KongIngress
metadata:
name: drone-drone
labels:
app: drone
component: server
release: drone
route:
preserve_host: true
@yurifrl
yurifrl / create-kms-secret.sh
Created November 8, 2018 20:42
Create secret on kms
#!/usr/bin/env sh
KEY=$1
VALUE=$2
INIT=$3
: "${KEYRING:=global}"
: "${LOCATION:=global}"
: "${SERVICE_ACCOUNT:?Variable not set or empty}"
gcloud () {
@yurifrl
yurifrl / package.json
Created October 31, 2018 17:05
Ava setup with babel tests with .test suporting async await for tests no for compiled code
{
"name": "name",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"build": "babel src -d dist/ --ignore '**/*.test.js'",
"test": "ava",
"flow": "flow"
},
#### Issue description
#### Steps to reproduce the issue
1.
2.
3.