Skip to content

Instantly share code, notes, and snippets.

View codymullins's full-sized avatar

Cody Mullins codymullins

View GitHub Profile
@davidfowl
davidfowl / FromSqlInterpolatedStringHandler.cs
Last active August 7, 2025 16:09
Implementation of parameterized sql queries using string interpolation handlers
using System.Data.Common;
using System.Runtime.CompilerServices;
using System.Text;
using Npgsql;
GetCatalogItemsSql(null, null, null, 10);
void GetCatalogItemsSql(int? catalogBrandId, int? before, int? after, int pageSize)
{
// This looks like it would be susceptible to SQL injection, but it's not.
@LanceMcCarthy
LanceMcCarthy / Example_A.MauiProgram.cs
Last active August 30, 2022 05:40
MAUI Window Position and Size (WinUI3 and MacCatalyst)
// ******** WinUI3 Window management ******** //
using Microsoft.Maui.LifecycleEvents;
#if WINDOWS
using Microsoft.UI;
using Microsoft.UI.Windowing;
using Windows.Graphics;
#endif
namespace MyApp.Maui
name: Build Windows Desktop
# https://github.com/actions/virtual-environments
on:
# push:
# branches: [ main ]
# pull_request:
# branches: [ main ]
@rkalkani
rkalkani / get-public-ip.md
Last active July 10, 2025 15:07
Get public IP address used by your machine to connect to the internet

Get Public IP

DNS

Google

dig o-o.myaddr.l.google.com txt @ns1.google.com +short
# OR
nslookup -type=txt o-o.myaddr.l.google.com ns1.google.com
@syntaqx
syntaqx / cloud-init.yaml
Last active September 30, 2025 19:50
cloud init / cloud config to install Docker on Ubuntu
#cloud-config
# Option 1 - Full installation using cURL
package_update: true
package_upgrade: true
groups:
- docker
system_info:
@asrivascrealytee
asrivascrealytee / grafana.nomad.hcl
Created March 11, 2019 16:17
Grafana+loki+promtail nomad example
job "grafana" {
datacenters = ["dc1"]
type = "service"
group "grafana" {
count = 1
restart {
attempts = 10
interval = "5m"
@jwcarroll
jwcarroll / modifyConnectionStrings.ps1
Created March 5, 2012 20:56
Set Connection String Powershell Function
Function Set-ConnectionString{
[CmdletBinding(SupportsShouldProcess=$True)]
Param(
[string]$fileName="app.config",
[string]$connectionStringName,
[string]$connectionString
)
$config = [xml](Get-Content -LiteralPath $fileName)