Skip to content

Instantly share code, notes, and snippets.

Avatar

Paul Irwin paulirwin

View GitHub Profile
@paulirwin
paulirwin / rf24.ino
Created Apr 9, 2018
RF24 issue with Hologram Dash
View rf24.ino
/*
Copyright (C) 2012 James Coliz, Jr. <maniacbug@ymail.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.
Update 2014 - TMRh20
*/
/**
* Simplest possible example of using RF24Network
@paulirwin
paulirwin / hot-reload-notifier.ts
Created Jul 18, 2017
Webpack Hot Reload Notification with Toastr
View hot-reload-notifier.ts
/// <reference path="../types/webpack-hot-middleware.ts" />
import { Message } from "webpack-hot-middleware/client";
import * as Toastr from "toastr";
declare global {
interface MessageEventHandler {
(event: MessageEvent): void;
}
@paulirwin
paulirwin / .dircolors
Created Apr 19, 2017
Dircolors/Vim config
View .dircolors
# Dark 256 color solarized theme for the color GNU ls utility.
# Used and tested with dircolors (GNU coreutils) 8.5
#
# @author {@link http://sebastian.tramp.name Sebastian Tramp}
# @license http://sam.zoy.org/wtfpl/ Do What The Fuck You Want To Public License (WTFPL)
#
# More Information at
# https://github.com/seebi/dircolors-solarized
@paulirwin
paulirwin / routing.php
Created Sep 30, 2016
CodeIgniter URL Suffix support for PHP Built-in Web Server
View routing.php
<?php
if (file_exists(__DIR__ . '/' . $_SERVER['REQUEST_URI'])) {
return false; // serve the requested resource as-is.
} else {
// this is the important part!
$_SERVER['SCRIPT_NAME'] = '/index.php';
include_once (__DIR__ . '/index.php');
}
@paulirwin
paulirwin / JaroWinklerStringSimilarity.sql
Last active Mar 29, 2021
Jaro-Winkler String Similarity in T-SQL
View JaroWinklerStringSimilarity.sql
-- Based on code here: http://www.sqlservercentral.com/articles/Fuzzy+Match/65702/
-- Modified to be used in SQL Server Database Projects or run on its own, and fixed similarity vs distance confusion
CREATE FUNCTION [dbo].JaroWinklerGetCommonCharacters(@firstWord VARCHAR(MAX), @secondWord VARCHAR(MAX), @matchWindow INT)
RETURNS VARCHAR(MAX) AS
BEGIN
DECLARE @CommonChars VARCHAR(MAX)
DECLARE @copy VARCHAR(MAX)
DECLARE @char CHAR(1)
DECLARE @foundIT BIT
@paulirwin
paulirwin / GetNewId.sql
Last active Mar 3, 2016
T-SQL NEWMSID() function for creating Azure Mobile Apps compatible IDs
View GetNewId.sql
CREATE VIEW [dbo].[GetNewId]
AS SELECT NEWID() AS [NewId]
View vs.bat
@echo off
start "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\devenv.exe" %1
View GetMissingIndexes.sql
SELECT
migs.avg_total_user_cost * (migs.avg_user_impact / 100.0) * (migs.user_seeks + migs.user_scans) AS improvement_measure,
'CREATE INDEX [IX_' + LEFT (PARSENAME(mid.statement, 1), 32) + '_' + REPLACE(REPLACE(REPLACE(ISNULL(mid.equality_columns,''), '[', ''), ']', ''), ',', '_')
+ CASE WHEN mid.equality_columns IS NOT NULL AND mid.inequality_columns IS NOT NULL THEN '_' ELSE '' END
+ REPLACE(REPLACE(REPLACE(ISNULL(mid.inequality_columns,''), '[', ''), ']', ''), ',', '_')
+ '] ON ' + REPLACE(mid.statement, '['+DB_NAME()+'].', '')
+ ' (' + ISNULL (mid.equality_columns,'')
+ CASE WHEN mid.equality_columns IS NOT NULL AND mid.inequality_columns IS NOT NULL THEN ',' ELSE '' END
+ ISNULL (mid.inequality_columns, '')
+ ')'
@paulirwin
paulirwin / Harness.fs
Created Jun 4, 2015
Smoke Testing in F# with Canopy
View Harness.fs
module harness
open canopy
open canopy.types
open runner
open System
let mutable baseurl = "http://localhost:49774"
let login username password =
@paulirwin
paulirwin / Program.cs
Last active Aug 29, 2015
Git repo most modified files analyzer
View Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LensLib
{
class Program
{