Skip to content

Instantly share code, notes, and snippets.

View geothachankary's full-sized avatar

Geo J Thachankary geothachankary

View GitHub Profile
@geothachankary
geothachankary / EnumStringConverter.cs
Last active October 28, 2024 10:52
Reference Code for Custom System.Text.Json Converters (Simple Guid to string converter, Enum to String from description attribute converter)
public class EnumStringConverter : JsonConverterFactory
{
public override bool CanConvert(Type typeToConvert)
{
return typeToConvert.IsEnum;
}
public override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions options)
{
return new EnumDescriptionConverter();
layout author title revision version description
default
mattmc3
Modern SQL Style Guide
2019-01-17
1.0.1
A guide to writing clean, clear, and consistent SQL.

Modern SQL Style Guide

@geothachankary
geothachankary / postgres_sequence_reset.sql
Created November 4, 2020 05:26
Query for resetting the PostgreSQL sequence
SELECT setval('sequence_name', 0);
@geothachankary
geothachankary / postgres_backup.sql
Last active November 4, 2020 05:27
Query for taking backup of a PostgreSQL database
SELECT pg_terminate_backend(pg_stat_activity.pid)
FROM pg_stat_activity
WHERE pg_stat_activity.datname = '[Database to copy]'
AND pid <> pg_backend_pid();
CREATE DATABASE "[Database to create]"
WITH TEMPLATE "[Database to copy]"
OWNER [Your username];
@geothachankary
geothachankary / dotnetlayout.md
Created August 21, 2020 10:17 — forked from davidfowl/dotnetlayout.md
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@geothachankary
geothachankary / postgres_queries_and_commands.sql
Created August 16, 2020 15:12 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages