Skip to content

Instantly share code, notes, and snippets.

View victorphamdeveloper's full-sized avatar

Victor Pham victorphamdeveloper

View GitHub Profile
Replace all instances of `foo` with `bar` in project
```
:grep foo
:cdo s/foo/bar/ | update
```
kubectl exec -n airflow -it airflow-worker-0 /entrypoint.sh -- /bin/bash
airflow backfill -s YYYY-MM-DD -e YYYY-MM-DD
airflow backfill command doc: https://airflow.apache.org/docs/stable/cli-ref#backfill
#!/bin/sh
fancy_echo() {
local fmt="$1"; shift
# shellcheck disable=SC2059
printf "\\n$fmt\\n" "$@"
}
append_to_zshrc() {
@victorphamdeveloper
victorphamdeveloper / connections-delete.sql
Last active November 5, 2018 10:01
Delete all pg connections
SELECT pg_terminate_backend(pg_stat_activity.pid)
FROM pg_stat_activity
WHERE pg_stat_activity.datname = 'TARGET_DB'
AND pid <> pg_backend_pid();
Delete evicted pods: kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod
Bee.transaction do
CSV.foreach(Rails.root.join('tmp', 'shopper_grade.csv'), headers: true) do |line|
email = line['Email']
grade = line['Corresponding Grade']
bee = User.find_by_email(email).bee
bee.shopper_grade = grade
bee.save!
end
end
@victorphamdeveloper
victorphamdeveloper / zshgit.md
Created March 2, 2017 07:03 — forked from AdamMarsden/zshgit.md
Oh My Zsh - Git Cheat Sheet

#Oh My Zsh - Git Cheat Sheet

ggit

gstgit status

glgit pull

gupgit pull --rebase