Skip to content

Instantly share code, notes, and snippets.

View sjardim's full-sized avatar
🏠
Working from home

Sérgio Jardim sjardim

🏠
Working from home
View GitHub Profile
Photo generation prompt for the Nano Banana model (using your uploaded photo as reference):
"A professional, high-resolution profile photo, maintaining the exact facial structure, identity, and key features of the person in the input image. The subject should be framed from the waist up, with ample headroom. The person looks directly at the camera. They are styled for a professional photo studio shoot, wearing a premium, smart-casual blazer in a subtle charcoal gray. The background is a solid '#562226' neutral studio color. Shot from a high angle with bright and airy soft, diffused studio lighting, gently illuminating the face and creating a subtle catchlight in the eyes, conveying a sense of clarity. Captured on an 85mm f/1.8 lens with a shallow depth of field, exquisite focus on the eyes, and beautiful, soft bokeh. Observe the crisp detail in the fabric texture of the blazer, individual strands of hair, and the natural, realistic skin texture. The beard should be trimmed. The atmosphere exudes confidence
@sjardim
sjardim / prompt.json
Created May 9, 2025 15:08
GPT-4o + JSON = next-level visuals with precision and style! By https://x.com/egeberkina
retexture the image attached based on the JSON aesthetic below:
{
"style": "photorealistic 3D render",
"material": "glass with transparent and iridescent effects",
"surface_texture": "smooth, polished with subtle reflections and refractive effects",
"lighting": {
"type": "studio HDRI",
"intensity": "high",
"direction": "angled top-left key light and ambient fill",
@sjardim
sjardim / Latex-Full-Year-Calendar.tex
Created April 1, 2025 13:09
A full year calendar in A1 paper size, showing US holidays.
% DIN-A1 year calendar
% Author: Robert Krause
% Modified by: Sérgio Jardim (@sjardim)
% License : Creative Commons attribution license
% Submitted to TeXample.net on 13 July 2012
\documentclass[landscape,a1paper,21pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz} % Use the calendar.sty style
@sjardim
sjardim / IndesignColorHeatmapTable.jsx
Created December 11, 2024 15:04
This script creates a "heatmap" table on Indesign. Uses tint values based on the cell's percentage value (from 100% to 0%)
/*
This script creates a "heatmap" table on Indesign:
- Checks for existing swatches named "HeatMapTableColor1", "HeatMapTableColor2", etc.
- Shows an error if no swatches are found with this naming pattern
- Shows an error if there aren't enough swatches for the table's columns
- Applies the colors in order (Color1 to first column, Color2 to second column, etc.)
- Uses tint values based on the cell's percentage value (from 100% to 0%)
- Maintains the text color logic (white text on dark backgrounds)
- If you don't want for the script to add a % after the values, if not present, comment the "// Add percentage sign if not present" block.
@sjardim
sjardim / clean_icml.py
Last active December 6, 2024 14:33
A Python script to clean up the paragraph and characters styles names from the converted Markdown to ICML file (via Pandoc).
# clean_icml.py
import sys
import re
import os
from pathlib import Path
def load_style_mappings():
"""Load style mappings from the configuration file"""
try:
# Get the directory of the current script
@sjardim
sjardim / UserResource.php
Last active March 20, 2024 07:25
Filament model with dependant selects
<?php
namespace App\Filament\Resources;
use App\Filament\Resources\UsersResource\Pages;
use App\Filament\Resources\UsersResource\RelationManagers;
use App\Models\Company;
use App\Models\Folder;
use App\Models\User;
use App\Models\Users;
@sjardim
sjardim / simulated-typing.html
Created June 27, 2023 18:33 — forked from fontanon/simulated-typing.html
Simulate typing on HTML Input Box with Javascript
<html>
<head>
<title>Simulated typing</title>
</head>
<body>
<input type="text" id="transcribe-searchbox" placeholder="Escribe Aquí">
<input type="button" id="transcribe-button" value="Transcibir a Andaluz">
</body>
<script>
// Quotes to simulate typing, then deletion
@sjardim
sjardim / Money.php
Last active August 25, 2025 11:29
Creating a Money custom field for Laravel Filament
<?php
declare(strict_types=1);
namespace App\Forms\Components;
use Filament\Forms\Components\Concerns\HasAffixes;
use Filament\Forms\Components\Field;
class Money extends Field
@sjardim
sjardim / filament_table_aggregates.php
Created April 19, 2023 20:17
Adds a sum, avg, count column to a Laravel Filament table
//Adapted from https://filamentphp.com/tricks/aggregate-data-in-table-footer
// On your Resource list page
protected function getTableContentFooter(): View
{
return view('tables.footer', [
'calc_columns' => [
[
'column' => 'monthly_fee_in_cents',
'operation' => 'sum',
@sjardim
sjardim / NavigationComposer.php
Last active March 14, 2023 15:34
A flexible front end navigation build using the Filament admin for Laravel
<?php
namespace App\View\Composers;
use Illuminate\View\View;
use RyanChandler\FilamentNavigation\Facades\FilamentNavigation;
class NavigationComposer
{