Skip to content

Instantly share code, notes, and snippets.

View 3coma3's full-sized avatar
🐧

3coma3

🐧
  • Smoose B.V.
  • Lisbon, PT
View GitHub Profile
@3coma3
3coma3 / main.yml
Last active March 26, 2020 21:48
Generic subtask dispatcher for multiplaform support in roles, using filename conventions
---
# Enforce order for task inclusion using filename tokens:
# 1) numeric index
# 2) component list
# 3) increasing platform specificity
- include_tasks:
file: '{{ taskfile }}'
loop: |
{%- set taskfiles = [] -%}
{%- set delimiter = '_' -%}
@3coma3
3coma3 / zoomsplit.vim
Last active March 26, 2020 21:25
add a map to vim to toogle zooming a split to max width/height - moving out to a same-tab split or closing the zoomed split also restores the window layout
function! ToggleZoom(toggle)
if exists("t:restore_zoom") && (t:restore_zoom.win != winnr() || a:toggle == v:true)
exec t:restore_zoom.cmd
unlet t:restore_zoom
elseif a:toggle
let t:restore_zoom = { 'win': winnr(), 'cmd': winrestcmd() }
vert resize | resize
endif
endfunction
augroup restorezoom
@3coma3
3coma3 / tmod
Last active March 11, 2022 04:21
extensible Terraform wrapper "to type less", for category/module structures, with regex/direct match|queued/chained operations|macros|tfvar expansion|+
#!/bin/bash
shopt -s extglob
# Globals ======================================================================
export script_path="$(readlink -f "$0")"
export script_name="${script_path##*/}"
export mods_root="$(readlink -f "${0%/*}/../provision")" category='' module=''
export -a all_mods=()
export -A global_sws=() cat_sws=() mod_sws=() switches=()