Skip to content

Instantly share code, notes, and snippets.

View aaronmbos's full-sized avatar
💻

Aaron Bos aaronmbos

💻
View GitHub Profile
@aaronmbos
aaronmbos / docker-compose.yml
Created February 10, 2023 03:23
docker_postgres
services:
postgres-db:
image: postgres:14.1
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_HOST_AUTH_METHOD: scram-sha-256
POSTGRES_INITDB_ARGS: --auth-host=scram-sha-256
ports:
- "5433:5432"
@aaronmbos
aaronmbos / Dockerfile
Created February 10, 2023 02:03
mssql_docker
# mssql-agent-fts-ha-tools
# Maintainers: Microsoft Corporation (twright-msft on GitHub)
# GitRepo: https://github.com/Microsoft/mssql-docker
# Base OS layer: Latest Ubuntu LTS
FROM ubuntu:16.04
# Install prerequistes since it is needed to get repo config for SQL server
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
@aaronmbos
aaronmbos / Program.cs
Created August 15, 2021 01:09
ImageSharp and IPTC Metadata
using System.Xml.Linq;
using System;
using System.Threading.Tasks;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Metadata.Profiles.Iptc;
using System.Linq;
namespace ImageMetadata
{
class Program
@aaronmbos
aaronmbos / DoSomethingAsync_Compiler.cs
Created June 5, 2021 03:44
Code for Asynchronous C# Below the Surface Post
using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
[CompilerGenerated]
private sealed class DoSomethingAsync_Compiler : IAsyncStateMachine
{
public int state; // Represents the current state of the state machine
@aaronmbos
aaronmbos / create-insert-person.sql
Last active February 6, 2024 21:10
Script to follow along with "Querying JSON Data in PostgreSQL" blog post
CREATE TABLE public.person
(
id integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
personb jsonb NOT NULL,
person json
)
insert into person (personb, person)
values (
'{"first_name": "Gladys", "last_name": "Perkins", "hobbies": ["Star Gazing", "Coding"]}',
public class Solution
{
public bool IsValid(string s)
{
if (s == null || s.Length % 2 != 0) { return false; }
if (s == string.Empty) { return true; }
var isOpenDict = new Dictionary<string, bool> { { "(", true }, { "{", true }, { "[", true }, { ")", false }, { "}", false }, { "]", false } };
var matches = new Dictionary<string, string> { { "(", ")" }, { "{", "}" }, { "[", "]" } };
var nested = new List<string>();
for (var i = 0; i < s.Length; i++)