Skip to content

Instantly share code, notes, and snippets.

View DamolAAkinleye's full-sized avatar
🎯

Damola Akinleye DamolAAkinleye

🎯
View GitHub Profile
@DamolAAkinleye
DamolAAkinleye / shallow_clone.py
Created October 20, 2024 15:50 — forked from lukeknxt/shallow_clone.py
Shallow clone all tables to another schema in a Databricks environment
"""
Use-case: automate clones in Databricks for dev testing similar to Snowflake's zero-copy clone.
This doesn't use the Catalog API as that may rely on cred passthrough
- https://docs.microsoft.com/en-us/azure/databricks/security/credential-passthrough/adls-passthrough
`py4j.security.Py4JSecurityException: method ... is not whitelisted on class org.apache.spark.sql.catalog.Table`
"""
prefixes = ["layer_a", "layer_b"] # prefix matching on schemas to copy over for layers
@DamolAAkinleye
DamolAAkinleye / gist:fc25e364f6e68ac038004b323d7b63bd
Created November 12, 2023 08:36 — forked from digitaljhelms/gist:4287848
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@DamolAAkinleye
DamolAAkinleye / gist:8b8a1f71b5f813b15e6bc0b9c1630dfd
Created July 15, 2022 07:12
extract management event from office 365
import adal, json, requests
clientid = "YOUR-APPLICATION-ID"
tenant_id = "YOUR-TENANT-ID"
resource = "https://manage.office.com"
private_key = open("YOUR-PRIVATE-KEY-FILENAME.pem", "r").read()
public_key_thumbprint = "YOUR-PUBLIC-KEY-THUMBPRINT"
#request access token
context = adal.AuthenticationContext('https://login.microsoftonline.com/{}'.format(tenant_id))
#!/usr/bin/env python
# coding: utf-8
#Import necessary libraries
import msal
import requests
import json
import pandas as pd
from datetime import date, timedelta
@DamolAAkinleye
DamolAAkinleye / 1572555067.txt
Created October 31, 2019 20:51
Created with Copy to Gist
96
97
98
99
100
101
102
103
104
@DamolAAkinleye
DamolAAkinleye / Azure-common2.ps1
Last active October 15, 2019 15:50
Created with Copy to Gist
param(
2
[Parameter(Mandatory=$True)]
3
[string]
4
$rootFolderPath,
5
6
@DamolAAkinleye
DamolAAkinleye / common.ps1
Last active October 15, 2019 15:45
Created with Copy to Gist
param(
[string]
$ParamFile = "common.parameters.txt",
[string]
$subscriptionId,
[string]
$certPassword,
@DamolAAkinleye
DamolAAkinleye / pre-commit.sh
Created October 3, 2019 05:02 — forked from akfish/pre-commit.sh
Run MSBuild and MSTest for C# project from git pre-commit hook
#!/bin/sh
# Helper
safeRunCommand() {
typeset cmd="$*"
typeset ret_code
echo cmd=$cmd
eval $cmd
ret_code=$?
@DamolAAkinleye
DamolAAkinleye / release.sh
Created November 7, 2018 20:52 — forked from bclinkinbeard/release.sh
Bash script to automate the Git Flow tag/release process
#!/bin/bash
# current Git branch
branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
# v1.0.0, v1.5.2, etc.
versionLabel=v$1
# establish branch and tag name variables
devBranch=develop
@DamolAAkinleye
DamolAAkinleye / git-helpers.zsh
Created November 7, 2018 20:27 — forked from justin808/git-helpers.zsh
zsh with git flow
# depends on justin808 gist named utility.zsh
# https://gist.github.com/justin808/bdef67f37c2cbdba898a
# See forum discussion: http://forum.railsonmaui.com/t/zsh-with-git-flow/135
#### GIT ####
# http://superuser.com/questions/458906/zsh-tab-completion-of-git-commands-is-very-slow-how-can-i-turn-it-off
# fix slow completion on files
# __git_files () {
# _wanted files expl 'local files' _files