Skip to content

Instantly share code, notes, and snippets.

Avatar

Shaun Wilde sawilde

View GitHub Profile
@sawilde
sawilde / time_convert_script.sql
Last active Mar 2, 2019
Converting UTC to Local time on SQL
View time_convert_script.sql
-- I acknowledge that someone showed me this and I have stolen it :)
declare @tz varchar(100) = 'AUS Eastern Standard Time';
--declare @tz varchar(100) = 'GMT Standard Time';
select id, update_time_utc as [updatedTimeUtc],
CONVERT(datetime, SWITCHOFFSET([update_time_utc], DATEPART(TZOFFSET, [update_time_utc] AT TIME ZONE @tz))) as [updatedTimeLocal]
from [your_table]
View sonarqube output
NAnt 0.91 (Build 0.91.3881.0; alpha2; 17/08/2010)
Copyright (C) 2001-2010 Gerry Shaw
http://nant.sourceforge.net
Buildfile: file:///O:/opencover/default.build
Target framework: Microsoft .NET Framework 4.0
Target(s) specified: sonarqube-build
sonarqube-build:
@sawilde
sawilde / remove_git_branches.md
Last active Mar 2, 2019
An alias to iterate all 1st level child folders and remove all local branches not in the safelist
View remove_git_branches.md

An alias to iterate all 1st level child folders and remove all local branches not in the safelist

alias -p bfg='for d in */; { echo $d; cd $d; { git checkout -q master; git branch | egrep -v "(^\*)|(^\s+(master|dev|hotfix|qa))" | xargs --no-run-if-empty git branch -D ; }; cd ..; };'

BEWARE: Only run if you are sure you really want to remove all branches not in the safe list - I normally do this at the end of a sprint/delivery and I know all branches are defunct other than master etc

NOTE: It can probably be improved

View regex_in_excel.vbs
'Turn on developer bar
'Add Extension "Microsoft vbscript regex 5.5"
' - Select "Developer" tab (I don't have this tab what do I do?)
' - Select "Visual Basic" icon from 'Code' ribbon section
' - In "Microsoft Visual Basic for Applications" window select "Tools" from the top menu.
' - Select "References"
' - Check the box next to "Microsoft VBScript Regular Expressions 5.5" to include in your workbook.
' - Click "OK"
Public Function RegexExtract(ByVal text As String, ByVal expr As String)
View build output #1 from issue 562 (gaurarpit12)
> git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git.exe config remote.origin.url https://github.com/gaurarpit12/ALM_POC.git # timeout=10
Fetching upstream changes from https://github.com/gaurarpit12/ALM_POC.git
> git.exe --version # timeout=10
> git.exe -c core.askpass=true fetch --tags --progress https://github.com/gaurarpit12/ALM_POC.git +refs/heads/*:refs/remotes/origin/*
> git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10
> git.exe rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10
Checking out Revision 65d7fe62fba9391450038cc9fdaf660f644a715b (refs/remotes/origin/master)
> git.exe config core.sparsecheckout # timeout=10
View build output #2 from issue 562 (gaurarpit12)
> git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git.exe config remote.origin.url https://github.com/gaurarpit12/ALM_POC.git # timeout=10
Fetching upstream changes from https://github.com/gaurarpit12/ALM_POC.git
> git.exe --version # timeout=10
> git.exe -c core.askpass=true fetch --tags --progress https://github.com/gaurarpit12/ALM_POC.git +refs/heads/*:refs/remotes/origin/*
> git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10
> git.exe rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10
Checking out Revision 65d7fe62fba9391450038cc9fdaf660f644a715b (refs/remotes/origin/master)
> git.exe config core.sparsecheckout # timeout=10
@sawilde
sawilde / OpenCover_CLA.md
Last active Jan 11, 2021
OpenCover CLA for MIT license (Harmony)
View OpenCover_CLA.md

OpenCover Individual Contributor License Agreement

Thank you for your interest in contributing to OpenCover ("We" or "Us"). This contributor agreement ("Agreement") documents the rights granted by contributors to Us. To make this document effective, please agree to it using the electronic submission process via https://cla-assistant.io/ when you submit your pull request; you will only need to resubmit should the agreement change. For more information please read the wiki article https://github.com/OpenCover/opencover/wiki/Contributor-License-Agreement-Q&A

This is a legally binding document, so please read it carefully before agreeing to it.

1. Definitions

"You" means the individual who Submits a Contribution to Us.

@sawilde
sawilde / CLA.md
Created Feb 24, 2016 — forked from pjcozzi/CLA.md
CLA for MIT license
View CLA.md

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I have the right to submit it under the MIT license; or

(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the MIT license; or

View arl_winforms_sample.cs
using System;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using MYOB.AccountRight.SDK;
using MYOB.AccountRight.SDK.Communication;
using MYOB.AccountRight.SDK.Services;
namespace arl_winforms_sample
{
public partial class Form1 : Form
@sawilde
sawilde / enumerables_to_blocks.cs
Last active Mar 2, 2019
Break an array into blocks
View enumerables_to_blocks.cs
var blockSize = 2;
var blocks = arrayListEnumerableOfThing
.Select((element, idx) => new { element, idx })
.GroupBy(x => x.idx / blockSize, x => x.element)
.Select(b => b.ToArray())
.ToArray();