Skip to content

Instantly share code, notes, and snippets.

View c9952594's full-sized avatar

Craig Norton c9952594

  • Callcredit
  • Leeds
View GitHub Profile
@c9952594
c9952594 / git-graphviz
Created August 6, 2021 01:16
Generate graphviz diagram from .git repository
#!/bin/bash
#IFS
# SAVEIFS=$IFS
# IFS=$'\n'
# allobjects=($allobjects)
# IFS=$SAVEIFS
# for (( i=0; i<${#allobjects[@]}; i++ ))
# do
# echo "$i: ${allobjects[$i]}"
dir -recurse -filter *.cs $src | foreach ($_) {
$file = $_.fullname
echo $file
(get-content $file) | where {$_ -notmatch "^.*\#(end)?region.*$" } | out-file $file
@c9952594
c9952594 / Clean.bat
Created November 1, 2018 10:30
Remove bin and obj folders
for /d /r . %%d in (bin,obj) do @if exist "%%d" rd /s/q "%%d"
@c9952594
c9952594 / commit-message-guidelines.md
Created September 10, 2018 07:43 — forked from robertpainsi/commit-message-guidelines.md
Commit message guidelines

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
@c9952594
c9952594 / UrlRewriteResources.ps1
Created August 15, 2018 09:28 — forked from sheastrickland/UrlRewriteResources.ps1
Powershell DSC for UrlRewrite Module install and ApplicationHost changes
Package UrlRewrite
{
#Install URL Rewrite module for IIS
DependsOn = "[WindowsFeaturesWebServer]windowsFeatures"
Ensure = "Present"
Name = "IIS URL Rewrite Module 2"
Path = "http://download.microsoft.com/download/6/7/D/67D80164-7DD0-48AF-86E3-DE7A182D6815/rewrite_2.0_rtw_x64.msi"
Arguments = "/quiet"
@c9952594
c9952594 / CreateVMs.ps1
Created July 10, 2017 19:11
Some scripts to help create Azure developer VM.
Import-LocalizedData -BaseDirectory .\ -FileName VmConfig.psd1 -BindingVariable Config
Login-AzureRmAccount
Select-AzureRmSubscription `
-SubscriptionName $Config.Azure.Subscription
New-AzureRmResourceGroup `
-Name $Config.ResourceGroup.Name `
@c9952594
c9952594 / FindThingsInSqlServer.sql
Created February 21, 2017 14:28
Find things in SQL Server
DECLARE @SearchTerm VARCHAR(MAX) = ''
SELECT sys.tables.name as [ObjectName], 'Table' as [ObjectType], sys.columns.name as [Column]
FROM sys.columns
JOIN sys.tables
ON sys.columns.object_id = sys.tables.object_id
WHERE LOWER(sys.columns.name) like '%' + LOWER(@SearchTerm) + '%'
UNION
@c9952594
c9952594 / VSPromptLink.reg
Last active August 2, 2016 10:51
Shortcut for opening a visual studio command prompt
@c9952594
c9952594 / BlackJackHelper.cs
Created July 25, 2016 01:33
An implementation of the BlackJack Helper coding challenge on CoderRadio
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using NUnit.Framework;
/* Slightly more logic to implement the implicit rules
*
* Program expects a single string as the input
@c9952594
c9952594 / ConsoleReader.cs
Created April 13, 2016 22:16
Add the ability to read the Console buffer
// http://stackoverflow.com/questions/12355378/read-from-location-on-console-c-sharp
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Text;
public class ConsoleReader {
public static IEnumerable<string> ReadFromBuffer(short x, short y, short width, short height) {