This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| ## Usage: qq here is my commit message | |
| ## Note: you don't need to quote your commit message since we are using "$*" | |
| ## If you have untracked files, you can add those before running the script, or modify it to add them by default | |
| git add -u | |
| git commit -m "$*" | |
| git push -u origin "$(git branch --show-current)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| !#/bin/bash | |
| ## INPUT ENV VARS: SRC_ACCOUNT_PROFILE, DST_ACCOUNT_PROFILE, SRC_ECR_REGISTRY_URI, DST_ECR_REGISTRY_URI | |
| for i in $(aws ecr describe-repositories --profile $SRC_ACCOUNT_PROFILE --query 'repositories[:].repositoryName' --output text) | |
| do | |
| echo "Started $i..." | |
| echo "Creating $i..." | |
| aws ecr create-repository --profile $DEST_ACCOUNT_PROFILE --repository-name $i | |
| for j in $(aws ecr describe-images --profile $SRC_ACCOUNT_PROFILE --repository-name $i --query 'sort_by(imageDetails,& imagePushedAt)[:].imageTags[0]' --output text) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export XDG_CONFIG_HOME="$HOME/.config" | |
| export XDG_DATA_HOME="$HOME/.local/share" | |
| export XDG_CACHE_HOME="$HOME/.cache" | |
| export XINITRC="${XDG_CONFIG_HOME}/x11/xinitrc" | |
| export ZDOTDIR="${XDG_CONFIG_HOME}/zsh" | |
| export HISTFILE="${XDG_DATA_HOME}/history" | |
| export DOTNET_ROOT=$HOME/.dotnet | |
| export PATH=$HOME/scripts:$PATH |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| from datetime import datetime, timedelta | |
| import json | |
| from pathlib import Path | |
| import os | |
| import requests | |
| def parse_time(txt): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export AWS_PAGER="" | |
| export AWS_REGION="us-west-2" | |
| output=$(aws rds describe-db-instances) | |
| rds_instances=$(echo $output | jq -r '.DBInstances[] | select((.DBInstanceStatus == "available") and (.DBClusterIdentifier == null) ) | .DBInstanceIdentifier') | |
| rds_clusters=$(echo $output | jq -r '.DBInstances[] | select((.DBInstanceStatus == "available") and (.DBClusterIdentifier != null) ) | .DBClusterIdentifier') | |
| for x in $rds_instances; do | |
| printf "Stopping RDS instance $x\n" | |
| aws rds stop-db-instance --db-instance-identifier $x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This is the script I use to switch my keyboard layout in linux (artix). I then assign it to the keyboard shortcut I want. | |
| # This example uses `ar` and `us`. You can add more than two and change those as well. | |
| lang1=ar | |
| lang2=us | |
| (setxkbmap -query | grep -q "layout:\s\+$lang2") && setxkbmap $lang1 || setxkbmap $lang2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| # Load the dataset | |
| movies = pd.read_csv("data/Movies.tsv", sep="\t") | |
| ratings = pd.read_csv("data/Ratings.tsv", sep="\t") | |
| #Create a mapping between id and title | |
| idx2title = {int(row["movieId"]): row["title"] for _, row in movies.iterrows()} | |
| title2idx = {j: i for i, j in idx2title.items()} |