Skip to content

Instantly share code, notes, and snippets.

View Radiohead229's full-sized avatar
🎯
Focusing

Raj Nayan Radiohead229

🎯
Focusing
View GitHub Profile
@Radiohead229
Radiohead229 / saved_models.py
Created May 18, 2025 10:04
a single custom function to save and export cnn model in keras and tensorflow format in a saved models directory
import os
def save_model_versioned(model, base_path="../saved_models"):
# Ensure the directory exists
os.makedirs(base_path, exist_ok=True)
# Determine the next version number by checking existing folders
existing_versions = [
int(i) for i in os.listdir(base_path) if i.isdigit()
]
@Radiohead229
Radiohead229 / dash_button.css
Created November 2, 2024 18:29
creating interactive buttons for dashboard urls, truncating text visuals, embedding dashboard urls using iframe in html
/* Button styling */
.dashboard-button {
display: inline-block;
padding: 10px 20px;
margin: 10px 0;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
@Radiohead229
Radiohead229 / big_num.css
Last active October 31, 2024 11:02
creating a pseudo element to add image to the big number charts, targeting individual chart ids, targeting chart viz types, styling for markdown texts
/*adding backgrund to all the big number charts*/
div[data-test-viz-type=big_number_total] {
background: linear-gradient(#eee, #fff);
border-radius: 8px;
padding: 2px;
}
/*creating a pseudo element to add image content for big number charts only*/
div[data-test-viz-type=big_number_total]::after {
position:absolute;
height: 50px;
@Radiohead229
Radiohead229 / con_value.sql
Last active October 25, 2024 14:52
queries on schema crop and table prod
UPDATE prod
SET production = production * 180 * 0.001
WHERE crop = 'Jute & Mesta ##';
UPDATE prod
SET production = production * 170 *0.001
WHERE crop = 'Cotton#';
-- converting lakh bales to tonnes for cotton, jute and mesta
UPDATE prod
SET production = ROUND(production, 2);