Skip to content

Instantly share code, notes, and snippets.

View btamayo's full-sized avatar
🏠
Working from home

Bianca Tamayo btamayo

🏠
Working from home
View GitHub Profile
@btamayo
btamayo / macro.gs
Last active May 13, 2023 05:31
How to programmatically pad a cell's height in Google Sheets
function ResizeRow() {
// Be careful about this. If you change this to `getActiveSpreadSheet()`, it will be super confusing:
// see https://www.reddit.com/r/GoogleAppsScript/comments/10dbe41/comment/j4knea5
var sheet = SpreadsheetApp.getActiveSheet();
var selection = sheet.getSelection();
var activeRange = selection.getActiveRange();
var rowsInSelection = activeRange.getNumRows();
var cell = selection.getCurrentCell();
var row = cell.getRow();
@btamayo
btamayo / kube-exec-into-latest-pod.zsh
Last active June 18, 2022 09:47
Exec into the latest pod. works most of the time, forgot to implement search I think. It's been a while since i've needed this.
# Load colors, use like this:
# autoload colors; colors
# echo $fg[green]text$reset_color
autoload -U colors; colors
for COLOR in RED GREEN YELLOW BLUE MAGENTA CYAN BLACK WHITE; do
eval $COLOR='%{$fg_no_bold[${(L)COLOR}]%}' #wrap colours between %{ %} to avoid weird gaps in autocomplete
eval BOLD_$COLOR='%{$fg_bold[${(L)COLOR}]%}'
done
eval RESET='%{$reset_color%}'
@btamayo
btamayo / kubectl.md
Created October 22, 2021 22:28 — forked from so0k/kubectl.md
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@btamayo
btamayo / git-branches-by-commit-date.sh
Created July 22, 2021 01:03 — forked from jasonrudolph/git-branches-by-commit-date.sh
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
GitHub::DGit::ThreePhaseCommitClient::PhaseQuorumError: all voting replicas failed while acquiring locks
@btamayo
btamayo / btamayo-functions.bash
Last active June 18, 2022 09:48
bash functions including date formatting
#!/usr/bin/env bash
BLACK=$(tput setaf 0)
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
YELLOW=$(tput setaf 3)
LIME_YELLOW=$(tput setaf 190)
POWDER_BLUE=$(tput setaf 153)
BLUE=$(tput setaf 4)
@btamayo
btamayo / download-gdsls.sh
Created September 12, 2020 22:44
Download GDSL for Jenkins jobs to import into IntelliJ
#!/usr/bin/env bash
# Pretty rough script on downloading GDSLs. Replace http://localhost:8080 with your Jenkins URL. You may have to
# provide an authtoken.
jobs_curl=$(curl --silent --location --request GET 'http://localhost:8080/api/json?tree=jobs\[name\]')
list=$(jq --raw-output '.jobs[] | .name' <<< "$jobs_curl")
write_gdsl_file() {
@btamayo
btamayo / README.md
Created June 12, 2020 05:09 — forked from joyrexus/README.md
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@btamayo
btamayo / example.md
Created June 12, 2020 05:09 — forked from ericclemmons/example.md
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 Summary Goes Here
@btamayo
btamayo / example.md
Created June 12, 2020 05:09 — forked from ericclemmons/example.md
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 Summary Goes Here