Skip to content

Instantly share code, notes, and snippets.

Avatar

Billy Jo ShowMeBillyJo

View GitHub Profile
@jkingsman
jkingsman / pride.sh
Created Mar 16, 2020
CLI Pride Flags
View pride.sh
#!/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
@vimtaai
vimtaai / markdown-flavors.md
Last active Aug 11, 2022
Comparison of features in various Markdown flavors
View markdown-flavors.md

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
View Config.cs
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));
View RetryHelperAsync.cs
using System;
using System.Configuration;
using System.Linq;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using log4net;
namespace Utils
{
View RetryHelper.cs
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
@wadewegner
wadewegner / addselftosqlsysadmin.cmd
Created Jan 25, 2012
Script to add the current user to the sysadmin role in SQL Server
View addselftosqlsysadmin.cmd
@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.
View regex-weburl.js
//
// 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)
//