Homebrew installs tools you need that Apple didn’t.
This file contains 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
-- Search default value constraints: | |
SELECT | |
obj.name | |
FROM | |
sys.objects AS obj | |
JOIN | |
sys.columns AS clm ON obj.object_id = clm.default_object_id | |
WHERE | |
obj.type = 'D' AND obj.parent_object_id = OBJECT_ID('User') AND clm.name = 'CompanyId'; | |
This file contains 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
from google.cloud.sql.connector import Connector, IPTypes | |
import pytds | |
import os | |
##### SQL connecter ############################################# | |
################################################################# | |
# Grabbing the user and password from environment variables | |
db_name = os.getenv("APPLICATION_DB") |
This file contains 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 os | |
from uuid import uuid4 | |
##### Memorize function for performance ################### | |
################################################################# | |
def get_id_tuple(f, args, kwargs, mark=object()): | |
l = [id(f)] | |
for arg in args: | |
l.append(id(arg)) |
This file contains 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
name: Deployer | |
##### | |
# | |
# Add this file to .github/workflows/google_app_engine_deployer.yml, then GitHub Actions will detect any updates on master/main branch and deploy changes. | |
# This example uses Node.js 18. You can choose any language you like. | |
# The build command is also `npm run build', change it as you like. | |
# | |
# 1. Set up service account for deployment and create key.json and set it to env variable | |
# 2. Create your app.yaml if you never deploy the app to GAE |
This file contains 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
name: Remove old versions of Google App Engine | |
##### | |
# | |
# Add this file to .github/workflows/delete-old-gae.yml then GitHub Actions will remove old versions of Google App Engine. | |
# | |
##### | |
on: | |
workflow_dispatch: |
This file contains 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 random | |
import string | |
def generate_random_string(): | |
selects = random.sample(string.ascii_uppercase, 3) + random.sample( | |
string.digits, 3) + random.sample(string.ascii_lowercase, 3) | |
random.shuffle(selects) | |
unique_code = ''.join(selects) | |
print(unique_code) | |
return unique_code |
OlderNewer