Skip to content

Instantly share code, notes, and snippets.

View PhilMurwin's full-sized avatar

Phil Murwin PhilMurwin

View GitHub Profile
@PhilMurwin
PhilMurwin / TSQL-READ_XML_into_Temp_Table.sql
Created March 9, 2021 22:10
Read XML into temp table on ms sql server
--=========================================================
-- SQL Server 2008 apparently has a bug that causes issues when trying to read from XML into a temporary table.
-- This can be overcome with the simple addition of an option to your query.
--=========================================================
-- Additional information can be found at the links below
--
-- http://connect.microsoft.com/SQLServer/feedback/details/562092/an-insert-statement-using-xml-nodes-is-very-very-very-slow-in-sql2008-sp1
-- http://stackoverflow.com/questions/3978807/why-insert-select-to-variable-table-from-xml-variable-so-slow
--=========================================================
@PhilMurwin
PhilMurwin / ListExtensions.cs
Last active February 7, 2023 22:29
Extension methods to serialize lists
using Newtonsoft.Json;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
@PhilMurwin
PhilMurwin / Visual Studio solution file headers
Last active February 22, 2022 21:02 — forked from DanAtkinson/Visual Studio solution file headers
Visual Studio solution file headers - 2003, 2005, 2008, 2010, 2012, 2013, 2015, 2017, 2019, 2022
== Visual Studio .NET 2003 (DO NOT COPY THIS LINE) ==
Microsoft Visual Studio Solution File, Format Version 8.00
# Visual Studio .NET 2003
VisualStudioVersion = 7.1
== Visual Studio 2005 (DO NOT COPY THIS LINE) ==
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
VisualStudioVersion = 8.0
@PhilMurwin
PhilMurwin / stringList.txt
Created August 23, 2019 20:23
C# List<string> A-Z, handy for testing filters, auto complete, etc. ( This list consists of star wars terms. )
var stringList = new List<string>
{
"Ackbar",
"Amidala",
"Anakin",
"Antilles",
"BB-8",
"Boba",
"Bossk",
"C-3PO",
@PhilMurwin
PhilMurwin / RasPiNamecheapDNS.md
Last active October 24, 2024 03:49
How to setup DDclient on Raspberry Pi for use with Namecheap DynDNS

How to use Namecheap DynDNS service with ddclient on the Raspberry Pi

Log into your Raspberry Pi (by ssh for example) or open a terminal window if you are working directly on Pi. In the first step we have to install ddclient, a DynDNS software, on the Pi. For this purpose, the following two commands are necessary.

sudo apt-get update
sudo apt-get install ddclient

Note: During installation an installation wizard opens and wants to know some things from you. Here you can safely enter what you want, because we have to adjust the configuration file manually either way, because the wizard does not support the Namecheap.com interface.

@PhilMurwin
PhilMurwin / git-ssh-auth-win-setup.md
Created October 12, 2018 20:19 — forked from bsara/git-ssh-auth-win-setup.md
Setup SSH Authentication for Git Bash on Windows

Setup SSH Authentication for Git Bash on Windows

Prepararation

  1. Create a folder at the root of your user home folder (Example: C:/Users/uname/) called .ssh.
  2. Create the following files if they do not already exist (paths begin from the root of your user home folder):
  • .ssh/config
@PhilMurwin
PhilMurwin / SchemaSearch.sql
Last active February 1, 2019 19:29
Search SQL Server Schema for keywords, helpful in finding tables, views, procs that reference a particular field etc.. ( psearchproc )
declare
@KeyWord varchar(128),
@KeyWord2 varchar(128) = null
set nocount on
set @KeyWord = ''
--=========================================================
-- Temp Tables
--=========================================================
@PhilMurwin
PhilMurwin / SSMS_Configs.md
Last active February 9, 2022 17:51
SQL Mgmt Studio Configs

Environment > Keyboard > Query Shortcuts

  • Create a Dev database to contain some server level procedures
  • Create a stored proc SPWHO with the sp_who2 script in it.
    • This is used for Ctrl + 3 below
Shortcut Stored Procedure
Alt + F1 sp_help
Ctrl + F1
@PhilMurwin
PhilMurwin / Synology-Diskstation-Git.md
Last active October 17, 2019 15:17 — forked from walkerjeffd/Synology-Diskstation-Git.md
Instructions for setting up git server on Synology Diskstation

Configure Synology NAS as Git Server

Instructions for setting up a git server on a Synology NAS with Diskstation. Specifically, I am using a DS218+ with DSM 6+.

Set Up User group and Folder

  • Create group gitusers via Diskstation interface (with File Station and WebDAV privilages)
  • Add new shared folder called Git (located at /volume1/Git) with read/write access for group gitusers. This folder will hold all the repos.
@PhilMurwin
PhilMurwin / .gitconfig
Last active December 7, 2016 19:40
Custom Git config (minus user section)
[core]
editor = \"C:/Program Files (x86)/Programmer's Notepad/pn.exe\"
autocrlf = true
[merge]
tool = winmerge
[mergetool "winmerge"]
cmd = wMerge.sh \"$MERGED\" \"$REMOTE\"
path = c:/Program Files (x86)/winmerge/winmergeu.exe
[diff]
guitool = winmerge