Skip to content

Instantly share code, notes, and snippets.

View patrickhaley's full-sized avatar
🟢
Active

Patrick Haley patrickhaley

🟢
Active
View GitHub Profile
@patrickhaley
patrickhaley / code-editor-rules.md
Created February 5, 2025 14:40 — forked from yifanzz/code-editor-rules.md
EP12 - The One File to Rule Them All

[Project Name]

Every time you choose to apply a rule(s), explicitly state the rule(s) in the output. You can abbreviate the rule description to a single word or phrase.

Project Context

[Brief description ]

  • [more description]
  • [more description]
  • [more description]
/**
* Using a single integer to represent multiple permissions
* based on binary values using bitwise operators
*
* & bitwise AND - if both the top and bottom bit are 1, result is 1
* | bitwise OR - if either the top and bottom bit or both are 1, result is 1
* ^ bitwise XOR - if only one of the bits are 1, result is 1
* 0101
* 0100 & = 0100
*
@patrickhaley
patrickhaley / prep-contacts.py
Created August 14, 2022 12:31 — forked from lrhazi/prep-contacts.py
Fix Contact Groups IDs
import csv,sys
# contact groups export from source account (CSV)
fn1=sys.argv[1]
# contact groups export from target account (CSV)
fn2=sys.argv[2]
# Exported contacts from source account
contacts_csv_fn=sys.argv[3]
# Exported contacts from source account (Corrected)
contacts_csv_fn2=sys.argv[4]
@patrickhaley
patrickhaley / copy-contacts.sh
Created August 14, 2022 12:30 — forked from lrhazi/copy-contacts.sh
Copy Google Workspace Contacts from one account to another
#!/bin/bash -x
shopt -s expand_aliases
alias gam='/root/bin/gamadv-xtd3/gam'
USER_SRC=$1
USER_DST=$2
CONTACTS_FN_SRC="/data/${USER_SRC}-contacts.csv"
CONTACTS_FN_DST="/data/${USER_DST}-contacts.csv"
CONTACTGROUPS_FN_SRC_CSV="/data/${USER_SRC}-contactgroups.csv"
CONTACTGROUPS_FN_SRC_JSON="/data/${USER_SRC}-contactgroups-json.csv"