Skip to content

Instantly share code, notes, and snippets.

@hrialan
hrialan / recover.sh
Created July 11, 2024 08:19
[BigQuery table recovery] Recover a BigQuery deleted table #bigquery #gcp
# sh
bq cp emea-sbxhrialan-gbl-emea-dv:dataform.first_view@-3600000 emea-sbxhrialan-gbl-emea-dv:dataform.first_view
@hrialan
hrialan / blank_line_regex.yaml
Created August 1, 2023 09:40
[Blank line regex] #regex
^(\s)*$\n
@hrialan
hrialan / bq_schema.sh
Last active April 13, 2023 08:15
[BQ schema] Get BigQuery table schema #gcp #bigquery
bq show --schema --format=prettyjson [PROJECT_ID]:[DATASET].[TABLE]
@hrialan
hrialan / delete_local_branch.sh
Created March 30, 2023 09:13
[Delete all branch except main] #git
git branch | grep -v "main" | xargs git branch -D
@hrialan
hrialan / shotcuts.md
Last active December 9, 2022 06:32
[Copilot] GitHub Copilot mac shortcuts #github #copilot #shotcuts
  • Seeing multiple suggestions in a new tab : Control + Enter

  • Generating code suggestions from comments :

# Connect to twitter API
# Return all tweets related to the given sub
def get_tweets(subject):
@hrialan
hrialan / reset_branch.sh
Created November 18, 2022 08:23
[Reset local branch] Reset local branch with the remote one. #git #github
git fetch origin
git reset --hard origin/main
git clean -df
git pull
@hrialan
hrialan / pre-commit.sh
Last active February 3, 2023 15:17
[pre-commit commands] #precommit #git
pre-commit install
pre-commit run --all-files
rm -r **/**/.terraform **/**/.terraform.lock.hcl
@hrialan
hrialan / terraform.sh
Created July 5, 2022 12:36
[Terraform fundamental commands] #terraform #gcp
terraform init
terraform plan
terraform apply
terraform destroy
terrraform fmt --recursive # Format code
terraform console
terraform import
# https://www.terraform.io/cli/commands
@hrialan
hrialan / env_variables.sh
Last active February 1, 2023 10:14
[ENV VARIABLES GCP] Most useful environments variables on GCP #gcp #env
# GCP Shell
$DEVSHELL_PROJECT_ID
@hrialan
hrialan / auth.sh
Last active February 1, 2023 10:13
[Authenticate GCP default application] #gcp #auth
gcloud auth application-default login