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
📊⚛️ |
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 uuid | |
from abc import ABC, abstractmethod | |
from typing import Any, Optional | |
import dash | |
import flask | |
from dash import Input, Output, State, dcc, html | |
from dash.development.base_component import Component | |
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
change_favicon_color=(c)=>{u=window.top.document.querySelector('link[rel="icon"], link[rel="shortcut icon"]');if(u.href.startsWith('data:')){console.log('Favicon is already a data URL.');return;}fetch(u.href).then(r=>r.blob()).then(b=>{i=new Image();i.src=URL.createObjectURL(b);i.onload=()=>{a=document.createElement('canvas'),ctx=a.getContext('2d');a.width=i.width;a.height=i.height;ctx.drawImage(i,0,0);ctx.globalCompositeOperation='source-in';ctx.fillStyle=c;ctx.fillRect(0,0,a.width,a.height);u.href=a.toDataURL('image/x-icon');}})}; |
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 re | |
from datetime import datetime | |
import pandas as pd | |
import argparse | |
def parse_log_files(file_names): | |
job_data = {} | |
job_pattern = re.compile(r'(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) (Thread-\d+) MYJOB (started|ended) (\d+) (.+)') | |
for file_name in file_names: |
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 pyspark.sql import SparkSession | |
from pyspark.sql import Row | |
# Initialize Spark Session | |
spark = SparkSession.builder.appName("Vertical Display").getOrCreate() | |
# Example DataFrame | |
data = [("Alice", 25), ("Bob", 30)] | |
columns = ["Name", "Age"] |
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 typing import List, Dict, Any, Tuple, Optional | |
from sqlalchemy import create_engine, text | |
from sqlalchemy.engine import Engine, ResultProxy | |
import pandas as pd | |
from pyspark.sql import SparkSession, DataFrame as SparkDataFrame | |
# Base class DataAccess using SQLAlchemy | |
class DataAccess: | |
def __init__(self, conn_str: str): | |
self.engine: Engine = create_engine(conn_str) |
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
# apple_runner.py | |
class AppleRunner: | |
def run(self): | |
print("Apple") | |
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 pandas as pd | |
import requests | |
from datetime import datetime, timedelta | |
from databricks import sql | |
class SqlWarehouseDataSource: | |
def __init__(self, host: str, http_path: str, client_id: str, client_secret: str, tenant_id: str, token_expiry_threshold: int = 300): | |
""" | |
Initialize the SqlWarehouseDataSource class with Databricks SQL connection details. |
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
e=document.querySelector('#Top_half').parentNode.nextSibling;while(e.previousSibling)e.parentNode.removeChild(e.previousSibling); | |
e=document.querySelector('#bodyContent');while(e.previousSibling)e.parentNode.removeChild(e.previousSibling); | |
e=document.querySelector('.mw-page-container');while(e.previousSibling)e.parentNode.removeChild(e.previousSibling); | |
e=document.querySelector('#mw-content-text');while(e.previousSibling)e.parentNode.removeChild(e.previousSibling); | |
e=document.querySelector('.mw-content-container');while(e.previousSibling)e.parentNode.removeChild(e.previousSibling); | |
e=document.querySelectorAll('#Seeds,#Seeded_players').forEach(e=>{e=e.parentNode.previousSibling;while(e.nextSibling && (!e.nextSibling.querySelector||!e.nextSibling.querySelector('#Top_half')))e.parentNode.removeChild(e.nextSibling)}); | |
document.querySelectorAll('.mw-editsection,#catlinks,.mw-footer-container,.vector-settings').forEach(e=>e.parentNode.removeChild(e)); | |
document.querySelectorAll('#Section_3,#Bottom_half,#Section_7'). |
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
#!/bin/bash | |
# Check if directory path is provided as an argument | |
if [ $# -ne 1 ]; then | |
echo "Usage: $0 <directory_path>" | |
exit 1 | |
fi | |
directory="$1" |
NewerOlder