Skip to content

Instantly share code, notes, and snippets.

View ShowMeBillyJo's full-sized avatar

Billy Jo ShowMeBillyJo

View GitHub Profile
using System;
using System.Configuration;
namespace Util
{
public static class Config
{
public static string GetSetting(string key) => ConfigurationManager.AppSettings[key];
public static bool HasSetting(string key) => !string.IsNullOrEmpty(GetSetting(key));
@alastairtree
alastairtree / RetryHelper.cs
Last active May 20, 2020 00:47
Retry helper
public static class RetryHelper
{
private static ILog logger = LogManager.GetLogger(); //use a logger or trace of your choice
public static void RetryOnException(int times, TimeSpan delay, Action operation)
{
var attempts = 0;
do
{
try
@jkingsman
jkingsman / pride.sh
Created March 16, 2020 01:04
CLI Pride Flags
#!/bin/bash
###
# Basically, these all loop through an array of xterm colors (https://upload.wikimedia.org/wikipedia/commons/1/15/Xterm_256color_chart.svg)
# and then prints out the block character (█) in that color {1..N} times (aka width) (see printf wizardry explained: https://stackoverflow.com/a/5349842)
###
# philly pride/poc
for c in 232 232 130 130 196 196 202 202 226 226 46 46 021 021 126 126;do printf "\033[38;05;${c}m%0.s█" {1..50};echo;done;echo
@wadewegner
wadewegner / addselftosqlsysadmin.cmd
Created January 25, 2012 18:35
Script to add the current user to the sysadmin role in SQL Server
@echo off
rem
rem ****************************************************************************
rem
rem Copyright (c) Microsoft Corporation. All rights reserved.
rem This code is licensed under the Microsoft Public License.
rem THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
rem ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
rem IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
rem PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
using System;
using System.Configuration;
using System.Linq;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using log4net;
namespace Utils
{
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//
@vimtaai
vimtaai / markdown-flavors.md
Last active March 24, 2024 15:29
Comparison of features in various Markdown flavors

Comparison of syntax extensions in Markdown flavors

I created a crude comparison of the syntax of the various common Markdown extensions to have a better view on what are the most common extensions and what is the most widely accepted syntax for them. The list of Markdown flavors that I looked at was based on the list found on CommonMark's GitHub Wiki.

Flavor Superscript Subscript Deletion*
Strikethrough
Insertion* Highlight* Footnote Task list Table Abbr Deflist Smart typo TOC Math Math Block Mermaid
GFM