- After making changes, ALWAYS make sure to start up a new server so I can test it.
- Always look for existing code to iterate on instead of creating new code.
- Do not drastically change the patterns before trying to iterate on existing patterns.
- Always kill all existing related servers that may have been created in previous testing before trying to start a new server.
- Always prefer simple solutions
- Avoid duplication of code whenever possible, which means checking for other areas of the codebase that might already have similar code and functionality
- Write code that takes into account the different environments: dev, test, and prod
- You are careful to only make changes that are requested or you are confident are well understood and related to the change being requested
- When fixing an issue or bug, do not introduce a new pattern or technology without first exhausting all options for the existing implementation. And if you finally do this, make sure to remove the old implementation afterwards so we d
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
// def sample_task(): | |
// x = 1 | |
// import debugpy | |
// debugpy.listen(5678) | |
// debugpy.wait_for_client() | |
// debugpy.breakpoint() | |
// print("This is a sample task executed by the DAG.") | |
// debugpy.breakpoint() |
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
from abc import ABCMeta, abstractmethod | |
import inspect | |
from airflow import DAG | |
from airflow.decorators import task | |
from datetime import datetime | |
# Define the metaclass for DAG creation | |
class DagMeta(ABCMeta): | |
def __new__(mcs, name, bases, attrs): | |
# Create the class using the standard process |
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 argparse | |
from databricks.sdk import WorkspaceClient | |
from databricks.sdk.core import Config | |
def main(): | |
# Parse command-line arguments | |
parser = argparse.ArgumentParser(description="Run an Azure Databricks job using a Service Principal") | |
parser.add_argument("--client_id", required=True, help="Azure Service Principal client ID") | |
parser.add_argument("--client_secret", required=True, help="Azure Service Principal client secret") | |
parser.add_argument("--tenant_id", required=True, help="Azure tenant ID") |
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 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
// Place your key bindings in this file to override the defaults | |
[ | |
{ | |
"key": "ctrl+k ctrl+s", | |
"command": "workbench.action.openGlobalKeybindings" | |
}, | |
{ | |
"key": "ctrl+m ctrl+s", | |
"command": "-workbench.action.openGlobalKeybindings" | |
}, |
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
Private IP Addresses: | |
• 10.0.0.0/8: Used for private networks. | |
• 172.16.0.0/12: Used for private networks. | |
• 192.168.0.0/16: Used for private networks. | |
Loopback Address: | |
• 127.0.0.0/8: Reserved for loopback (localhost). | |
Link-local Addresses: | |
• 169.254.0.0/16: Used for automatic IP addressing when DHCP fails. |
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
// Define the path to the new folder in ADLS | |
val adlsFolderPath = "abfss://<container-name>@<storage-account-name>.dfs.core.windows.net/<folder-path>" | |
// Create the new folder | |
dbutils.fs.mkdirs(adlsFolderPath) | |
// Verify if the folder was created | |
val folderExists = dbutils.fs.ls(adlsFolderPath).nonEmpty | |
if (folderExists) { |
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
from multiprocessing import Process, Queue | |
def writer_process(output_dir): | |
"""Single process dedicated to writing files""" | |
while True: | |
msg = write_queue.get() | |
if msg == 'STOP': | |
break | |
date_str, data = msg | |
filepath = f"{output_dir}/daily_{date_str}.csv" |
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 Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ | |
// © mrinalrajubereats1 | |
//@version=6 | |
indicator("My script") | |
log.info("\n########### Day starts ###########") | |
func1() => | |
var a = 0 |
NewerOlder