Skip to content

Instantly share code, notes, and snippets.

View sawilde's full-sized avatar

Shaun Wilde sawilde

View GitHub Profile
@sawilde
sawilde / docker-compose.yml
Created November 14, 2021 22:25 — forked from seanhandley/docker-compose.yml
How To Set Up Docker For Mac (Mojave) with Native NFS
version: '2'
services:
api:
volumes:
- "nfsmount:${CONTAINER_DIR}"
volumes:
nfsmount:
driver: local
driver_opts:
@sawilde
sawilde / updateDynomoDB.ts
Created October 8, 2021 09:31
safe update of document db by replacing all keys and values by substitutions (avoiding reserved name conflicts)
import AWS from 'aws-sdk';
export const TABLE_NAME = 'table_name_here';
export const documentClient = new AWS.DynamoDB.DocumentClient({
region: process.env.TARGET_REGION,
});
export const updateRecord = (attributes: any, key: any) => {
const map = new Map(Object.entries(attributes));
@sawilde
sawilde / time_convert_script.sql
Last active March 2, 2019 01:49
Converting UTC to Local time on 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]
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 March 2, 2019 04:36
An alias to iterate all 1st level child folders and remove all local branches not in the safelist

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

@sawilde
sawilde / regex_in_excel.vbs
Last active April 1, 2019 22:30
RegEx in excel
'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)
> 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
> 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 January 11, 2021 02:34
OpenCover CLA for MIT license (Harmony)

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 February 24, 2016 09:28 — forked from pjcozzi/CLA.md
CLA for MIT license

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