Skip to content

Instantly share code, notes, and snippets.

View disouzam's full-sized avatar
🚲

Dickson Souza disouzam

🚲
View GitHub Profile
@lemire
lemire / github.py
Created December 31, 2025 22:45
Get your GitHub activity for 2025
#!/usr/bin/env python3
# uv run lemire.py --token <your_github_token> --user <github_username>
#
# To generate a GitHub Personal Access Token:
# 1. Go to https://github.com/settings/tokens
# 2. Click "Generate new token (classic)"
# 3. Give it a name, e.g., "GitHub Search Script"
# 4. Select scopes: For public repositories, select "public_repo". For private, select "repo".
# 5. Click "Generate token"
# 6. Copy the token and use it as --token argument.
@Shivani-Gonde
Shivani-Gonde / BlogPost_Cu_Met_CA4Py_BP1_ProcessModel.rst
Last active January 12, 2026 11:46
Cu Pyrometallurgy process model

Optimizing Copper Extraction: Integrated Pyrometallurgical Modelling with ChemApp for Python - Part I

Introduction

Process modelling is a key approach for optimizing industrial operations, delivering tangible gains in cost reduction, process efficiency, and environmental performance. In copper extraction, pyrometallurgical routes consist of multiple interconnected unit operations that must be considered together to understand overall behavior. Using its stream functionality, ChemApp for Python provides rigorous thermochemical calculations that allow engineers to link these unit operations into an integrated copper process flowsheet. This post presents a step-by-step guide for metallurgists and engineers on building such Cu flowsheets and computing copper output and purity under defined operating conditions for each process step. During copper extraction, the two main performance targets are the total coppe

from collections import defaultdict
from graphlib import TopologicalSorter
from heapq import heappush, heappop, heapify
def topo_lex(pairs):
deps = defaultdict(set) # node -> set(dependencies)
for a, b in pairs:
deps.setdefault(a, set())
deps[b].add(a)
@fernandobarbalho
fernandobarbalho / servidores_nivel_superior.sql
Created April 11, 2025 16:48
Busca a proporção de servidores com nível superior para os municípios brasileiros usando dados da RAIS
# Os dados estão presentes no repositório big query da base dos dados
SELECT id_municipio,
count(*) as quantidade_nivel_superior,
( select count(*)
from `basedosdados.br_me_rais.microdados_vinculos` vinc_sub
where vinc_sub.id_municipio = vinc.id_municipio and
ano = 2023 and
vinculo_ativo_3112 ="1" and
natureza_juridica = "1244") as total_servidores_municipio, #1244= município
# Long command with many parameters all on one line
Send-MailMessage -From "admin@example.com" -To "user@example.com" -Subject "Test Email" -Body "This is a test email." -SmtpServer "smtp.example.com" -Port 587 -UseSsl -Credential (Get-Credential) -Attachments "C:\path\to\file.txt" -Priority High -DeliveryNotificationOption OnSuccess, OnFailure
# Equivalent command using splatting for readability
$mailParams = @{
From = "admin@example.com"
To = "user@example.com"
Subject = "Test Email"
Body = "This is a test email."
SmtpServer = "smtp.example.com"
@juligaioso
juligaioso / #30DaysOfCTF
Last active May 13, 2024 15:17
30 days of CTF
For the next 30 days, I decided to improve my pentesting skills. So, inspired in the challenge of #100DaysOfCode, i create the challenge #30DaysOfCTF.
## Main Rules:
1. Resolve a CTF challenge every day;
2. Create and publish a WriteUp about the CTF;
3. Share my progress and the WriteUp in the social midia with the hashtag #30DaysOfCTF.
My #30DaysOfCTF starters in 05/13/2024.
@davepcallan
davepcallan / AddColumnIfNotExists.sql
Created May 7, 2024 16:20
Add created_date column to all tables which don't have it already in SQL Server
SELECT 'ALTER TABLE ' + QUOTENAME(ss.name) + '.' + QUOTENAME(st.name) + ' ADD created_date DATETIME NULL;'
FROM sys.tables st
INNER JOIN sys.schemas ss on st.[schema_id] = ss.[schema_id]
WHERE st.is_ms_shipped = 0
AND NOT EXISTS (
SELECT 1
FROM sys.columns sc
WHERE sc.[object_id] = st.[object_id]
AND sc.name = 'created_date'
)
@MelbourneDeveloper
MelbourneDeveloper / .editorconfig
Last active January 31, 2024 22:43
Directory.Build.props Enable All Errors
[*.{cs,vb}]
dotnet_diagnostic.CA1062.severity = none
# IDE0022: Use block body for method
csharp_style_expression_bodied_methods = true
# IDE0032: Use auto property
dotnet_style_prefer_auto_properties = true
#CSharpier Incompatible Rules
@schacon
schacon / better-git-branch.sh
Created January 13, 2024 18:41
Better Git Branch output
#!/bin/bash
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
NO_COLOR='\033[0m'
BLUE='\033[0;34m'
YELLOW='\033[0;33m'
NO_COLOR='\033[0m'