Skip to content

Instantly share code, notes, and snippets.

View disouzam's full-sized avatar
🚲

Dickson Souza disouzam

🚲
View GitHub Profile
# 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'
@karenpayneoregon
karenpayneoregon / someprojectfile.csproj
Last active February 7, 2024 19:33
reduced source path
<PropertyGroup>
<PathMap>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)'))=./</PathMap>
</PropertyGroup>
@giggio
giggio / palestrasg.md
Last active January 29, 2024 01:12
Links da palestra sobre Roslyn Source Generators