Skip to content

Instantly share code, notes, and snippets.

View tanduong's full-sized avatar

Tan Duong tanduong

View GitHub Profile
@tanduong
tanduong / mouse_click.py
Created April 25, 2024 14:49 — forked from unix-beard/mouse_click.py
This is how you control the mouse programmatically under Mac OS X
import time, sys
from Quartz.CoreGraphics import CGEventCreateMouseEvent
from Quartz.CoreGraphics import CGEventCreate
from Quartz.CoreGraphics import CGEventPost
from Quartz.CoreGraphics import CGEventGetLocation
from Quartz.CoreGraphics import kCGEventMouseMoved
from Quartz.CoreGraphics import kCGEventLeftMouseDown
from Quartz.CoreGraphics import kCGEventLeftMouseUp
from Quartz.CoreGraphics import kCGMouseButtonLeft
from Quartz.CoreGraphics import kCGHIDEventTap
@tanduong
tanduong / ecto_postgresql_migration.ex
Created April 27, 2023 06:41 — forked from ibarchenkov/ecto_postgresql_migration.ex
Ecto migration helpers for PostgreSQL.
defmodule MyApp.Migration do
@moduledoc """
Additional helpers for PostgreSQL.
"""
import Ecto.Migration, only: [execute: 2]
defmacro __using__(_) do
quote do
use Ecto.Migration
@tanduong
tanduong / README.md
Created June 1, 2022 16:58 — forked from jmahowald/README.md
using terraform to wire GCP workload identity federation

Authenticating for bootstrap

gcloud auth application-default login A web browser should open up, asking you to authorize access .

You can set up a default tfvars for the input. For instance


project_id = "internal-lab"
aws_identity_pool_info = {
@tanduong
tanduong / comparison.md
Created May 25, 2022 08:28 — forked from jordansissel/comparison.md
DynamoDB is silly expensive
@tanduong
tanduong / gist:41fe5e4f42553d690b10ca68d98d9201
Created May 1, 2021 01:40 — forked from olivierlacan/gist:4062929
Code School Screencasting Framework

Screencasting Framework

The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.

Why you should care about screencasting?

You're probably aren't going to take the time to read this document if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.

  1. Communicating more effectively - At Envy Labs we produce screencasts for our clients all the time. Whether it's demoing a new feature or for a presentation for an invester, they're often much more effective and pleasent than a phone call or screen sharing.
@tanduong
tanduong / vscode_shortcuts.md
Created April 9, 2021 14:50 — forked from bradtraversy/vscode_shortcuts.md
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

If you have any other helpful shortcuts, feel free to add in the comments of this gist :)

Official List of all commands

spec:
template:
spec:
containers:
- name: airflow-worker
resources:
requests:
memory: 2Gi
limits:
memory: 2Gi
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: airflow-worker
namespace: # use ${AIRFLOW_WORKER_NS} variable defined above
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: airflow-worker
#!/usr/bin/env bash
set -e
PROJECT=[provide your gcp project id]
COMPOSER_NAME=[provide your composer environment name]
COMPOSER_LOCATION=[provide the selected composer’s location e.g. us-central]
CLUSTER_ZONE=[provide the selected composer’s zone e.g. us-central1-a]
# Enable autoscaling in node level
GKE_CLUSTER=$(gcloud composer environments describe \
@tanduong
tanduong / zshrc
Created December 16, 2019 12:46 — forked from LukeSmithxyz/zshrc
# Luke's config for the Zoomer Shell
# Enable colors and change prompt:
autoload -U colors && colors
PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "
# History in cache directory:
HISTSIZE=10000
SAVEHIST=10000
HISTFILE=~/.cache/zsh/history