Skip to content

Instantly share code, notes, and snippets.

The scenario

At a certain point in time we want to lock a CMI period to a forecasted amount.

possible business outcomes:

  1. A lock already exists
  2. We lock in the same CMI
  3. We lock in a different CMI

Other issues are possible:

@Velrok
Velrok / app.rb
Created May 16, 2024 22:47
ruby in the browser
require "js"
# access to the html document, so we can add visual elements like buttons
document = JS.global[:document]
# jq is a library which provides easer to read function to add elements
jq = JS.global['$']
# write the initial html, we give every element an ID so we can address them later
jq.apply("#main").html(
<<HTML
@Velrok
Velrok / kitty.conf
Created August 30, 2023 10:40
symbol_map config for kitty terminal using Symbols Nerd Font Mon as fallback font for icons
# https://github.com/ryanoasis/nerd-fonts/wiki/Glyph-Sets-and-Code-Points
symbol_map U+E5FA-U+E62B Symbols Nerd Font Mono
# Devicons
symbol_map U+e700-U+e7c5 Symbols Nerd Font Mono
# Font Awesome
symbol_map U+f000-U+f2e0 Symbols Nerd Font Mono
# Font Awesome Extension
symbol_map U+e200-U+e2a9 Symbols Nerd Font Mono
# Material Design Icons
symbol_map U+f0001-U+f1af0 Symbols Nerd Font Mono
@Velrok
Velrok / tuis.md
Created July 25, 2022 08:20
presentation on text UIs

The power of command line tools

Topics

  1. modern fast replacements for established use cases
  2. new more powerful tools
  3. interactive command line tools aka text UI or TUI

@Velrok
Velrok / bq-vd
Created June 24, 2022 21:29
NeoVim BigQuery integration. Sends current file content as query to BQ and opens result in terminal split with VisiData.
#!/usr/bin/env bash
set -e
query_file="$1"
# use json instead of csv, because I had an error where BQ complained it could not render a field as csv table
bq query --format json --headless -sync -quiet < "$query_file" 2>/dev/null \
| vd --filetype json

The power of command line tools

Topics

  1. modern fast replacements for established use cases
  2. new more powerful tools
  3. interactive command line tools aka text UI or TUI

@Velrok
Velrok / jira-tickets-active.sh
Last active June 17, 2022 11:39
List and preview active tickets. Fuzzy search and preview via fzf.
#!/usr/bin/env bash
set -e
# brew install ankitpokhrel/jira-cli/jira-cli fzf
jira issue list \
--columns KEY,STATUS,SUMMARY,RESOLUTION,ASSIGNEE \
--resolution x \
--type ~Epic \
───────┬────────────────────────────────────────────────────────────────────────
│ File: /Users/waldemar/.config/nvim/init.vim
───────┼────────────────────────────────────────────────────────────────────────
1 │ call plug#begin()
2 │ " Global:
3 │ Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
4 │ " Plug 'kien/ctrlp.vim'
5 │ Plug 'tpope/vim-sensible'
6 │ Plug 'rking/ag.vim'
7 │ Plug 'scrooloose/nerdtree'
@Velrok
Velrok / infer-spec.clj
Created May 21, 2019 13:28
A command line tool to infer a clojure spec from a line seq of data.
#!/usr/bin/env inlein
'{:dependencies [[org.clojure/clojure "1.10.0"]
[spec-provider "0.4.14"]
[org.clojure/tools.cli "0.4.2"]
[cheshire "5.8.1"]]}
(require '[cheshire.core :as json])
(require '[clojure.edn :as edn])
(require '[spec-provider.provider :as sp])
(require '[clojure.string :as string])
@Velrok
Velrok / edn-to-json.clj
Last active April 10, 2019 11:26
cli to convert edn to json
#!/usr/bin/env inlein
'{:dependencies [[org.clojure/clojure "1.10.0"]
[cheshire "5.8.1"]]}
(require '[cheshire.core :as json])
(require '[clojure.edn :as edn])
(defn read-edn
[s]
(try