Skip to content

Instantly share code, notes, and snippets.


Danny Kendrick dkendrick

  • Inspire Group
  • New Zealand
View GitHub Profile
View gist:b46acfd465e5814915f14e748f1b35cd
"auto_complete": true,
"auto_complete_commit_on_tab": true,
"copy_with_empty_selection": true,
"ensure_newline_at_eof_on_save": true,
"index_files": true,
View boxstarter.txt
# base from
# Boxstarter options
$Boxstarter.RebootOk=$true # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?
$Boxstarter.AutoLogin=$true # Save my password securely and auto-login after a reboot
# Basic setup
Update-ExecutionPolicy Unrestricted
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar
dkendrick / _google_analytics.html.erb
Created Apr 23, 2018
Google analytics only in production - rails
View _google_analytics.html.erb
<% if Rails.env == "production" %>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src=""></script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-000000000-1');
dkendrick / git_kdiff_setup.cmd
Created Nov 2, 2017
Setup git to use kidff3 as default merge tool and diff tool
View git_kdiff_setup.cmd
git config --global --add merge.tool kdiff3
git config --global --add mergetool.kdiff3.path "C:/Program Files/KDiff3/kdiff3.exe"
git config --global --add mergetool.kdiff3.trustExitCode false
git config --global --add diff.guitool kdiff3
git config --global --add difftool.kdiff3.path "C:/Program Files/KDiff3/kdiff3.exe"
git config --global --add difftool.kdiff3.trustExitCode false
dkendrick / CSVPrinter.js
Last active Sep 7, 2019
Print mongo result to CSV
View CSVPrinter.js
/*globals db*/{
_id : 'CSVPrinter',
value : function CSVPrinter() {
var firstRun = true;
function checkFirstRun(record){
if (firstRun) {
firstRun = false;
dkendrick / powershell-bg-task
Created Nov 4, 2014
Run tasks in the background with powershell. This was inspired by the "&" functionality of bash.
View powershell-bg-task
function bg()
if ($args.length -lt 0)
Write-Output "No parameters specified";
if ($args.length -gt 1)
dkendrick / test2.cs
Created Aug 13, 2012
Unit test to ensure all methods of factory run correctly 2
View test2.cs
public delegate ITransaction MyDelegate();
public class BlogExampleTests
private static readonly TransactionFactory Factory = new TransactionFactory();
private static object[] delegates = new[]
new MyDelegate(Factory.GetTransactionA),
new MyDelegate(Factory.GetTransactionB),
dkendrick / test1.cs
Created Aug 13, 2012
Unit test to ensure all methods of factory run correctly 1
View test1.cs
public class BlogExampleTests
private TransactionFactory factory;
public void SetUp()
factory = new TransactionFactory();
dkendrick / generatedtest.cs
Created Aug 13, 2012
Unit test to ensure all methods of factory run correctly
View generatedtest.cs
public class BlogExampleTests
private TransactionFactory factory;
private static readonly Type FactoryType = typeof(TransactionFactory);
public void SetUp()
var parameters = new Type[0];
dkendrick / psniffing2.sql
Created Aug 12, 2012
Parameter sniffing working around example SQL Server
View psniffing2.sql
@FirstName varchar(100),
@LastName varchar(100)
-- Variables added to prevent problems that were occuring with parameter sniffing
@FName VARCHAR(100),
@LName VARCHAR(100)