Skip to content

Instantly share code, notes, and snippets.

View andykuszyk's full-sized avatar

andykuszyk

  • Deliveroo
  • Southampton, UK
View GitHub Profile
@andykuszyk
andykuszyk / Performance profiling NUnit tests using Visual Studio 2015.md
Last active February 14, 2018 17:13
Performance Profiling NUnit tests using Visual Studio 2015

Performance Profiling NUnit using Visual Studio 2015

Shortly after learning about the great performance profiling tools built into Visual Studio 2015 (we've just upgraded from 2010, when the best free solution was to use SlimTune [which is awesome for a free, unsupported, open-source tool, but not as awesome as the tools in VS 2015]), I wanted to be able to performance profile slow running unit tests.

Previously, using the afore mentioned SlimTune (https://code.google.com/archive/p/slimtune/), I would run the NUnit gui runner and run the test I was interested in. Although this is still an option using the new VS tools, it doesn't give you a very accurate picture of what's taking the time and, importantly, results in the "hot path" analysis not being useful.

As such, I followed these simple steps to profile my first few tests.

1. Prepare the test for profiling

Nothing special here, I just marked the test for profiling with a unique category so I could pull it out and run it independently from the com

@andykuszyk
andykuszyk / Awesome task lists with Github markdown.md
Last active January 31, 2016 14:49
Awesome task lists with Github markdown

The future is now with Github flavoured markdown

I've just been reading around about the sort of content we can use on Gist, Github issue tracker issues and comments, and it turns out there's an awesome, slightly unusual feature that Github markdown supports.

If you want a to-do list, then all you need to do is start each item in the list with:

- [ ] Something I need to do.
@andykuszyk
andykuszyk / Everyday Git Commands.md
Last active April 20, 2016 08:37
Everyday Git Commands

Everyday Git Commands

This document is just a collection of everyday commands that I use to perform common Git operations.


Checking out a remote branch

To checkout a remote branch into a new local branch that tracks the remote equivilant:

git checkout -t origin/[remote-branch-name]

@andykuszyk
andykuszyk / Useful Git Hooks.md
Last active April 19, 2017 20:52
Useful Git Hooks

#Useful Git Hooks

Below are a couple of simple git hooks that can be useful for controlling and formatting commits. These are generally re-hashes of other people's ideas, so I've credited these as appropriate.

Git Hooks

A git hook is a script that lives in your .git/hooks directory. The scripts are invoked when certain events occur within your repo, such as make a commit or pushing changes. Hooks can be used to automate and augment basic actions within your repos.

##Include an issue number in your commit message To amend your commit messages after they have been submitted, you'll need a commit-msg hook. I borrowed most of these ideas from @monkseal. This hook assumes that your issue numbers are formatted into you branch names in a way that you can extract using a regex.

@andykuszyk
andykuszyk / Integrating BitBucket with JIRA in the cloud.md
Last active March 7, 2016 11:27
Integrating BitBucket with JIRA in the cloud

Integrating BitBucket with JIRA in the cloud

Introduction

BitBucket and JIRA can be integrated such that JIRA issues display a development panel that allows you to create branches and pull requests and which can display commits that relate to that issue.

In order to setup this integration, a number of steps need to be followed that are widely documented, especially by Atlassian. I'm just noting down some of the perculiarities that helped me to get this setup.

Setting up POST services in BitBucket

In order for JIRA to remain up-to-date with BitBucket when things change in a repo, your repo needs to have two POST services configured. These are normally added automatically when you link a JIRA account with a BitBucket account, but if not:

@andykuszyk
andykuszyk / Delete all data from a SQL Server database.md
Last active April 25, 2016 09:27
Delete all data from a SQL Server database

Delete all data from a SQL Server database

Why?

At the moment, I'm experimenting with interactions with a new database. I could very easily create the schema once and then take a backup of the database, restoring this backup every time I want to start again with a fresh copy.

However, it's a little more hassle free to leave the database in situ (especially because I want to use the same connection details each time) and just nuke all the data instead.

How?

Removing all the data from a database is almost as easy as running a DELETE FROM for every table, except that you need to suspend constraints temporarily whilst you're doing so:

@andykuszyk
andykuszyk / Git command line cheat sheet.md
Last active May 6, 2016 08:47
Git command line cheat sheet

#Git command line cheat sheet

Workflow

In a typical workflow, you might perform the following steps in approximately this order:

  1. Fetch metadata about new branches from the remote repo;
  2. Checkout a remote branch locally;
  3. Stage changes;
  4. Commit changes (and repeat);
  5. Push your changes to the remote topic branch;
@andykuszyk
andykuszyk / Running NUnit3 tests in Go CD.md
Created May 9, 2016 09:01
Running NUnit3 tests in Go CD

#Running NUnit3 tests in Go CD

Running NUnit3 tests under Go CD is easy enough using the console runner, but the outputted test results are not understood by Go, even when you mark them as a test artifact.

In order for them to be recoginized by Go, you need to output the test results xml file in the NUnit2 version.

This can be done by adding the following option to your command line call@

--result=TestResult.xml;format=nunit2

@andykuszyk
andykuszyk / Installing multiple Bamboo remote agents on a single machine.md
Last active December 14, 2023 18:04
Installing multiple Bamboo remote agents on a single machine (as a Windows service)

Installing multiple Bamboo remote agents on a single machine (as a Windows service)

I've recently been setting up multiple remote agents for Bamboo on the same machine to run as Windows service instances. Although there's information out there as to how this is achieved, I thought I'd document all the steps here for future reference.

Pre-requisites

Assumptions are that you have:

  • Installed Bamboo on a server somewhere;
  • Have another machine that you want to install remote agents on;
  • This other machine can access the server over http;
  • The other machine has java installed on it;
@andykuszyk
andykuszyk / Common Powershell commands.md
Last active October 13, 2016 09:20
Common Powershell commands

A collection of common Powershell commands that I frequently use.

Outputting to the console

Write to the console with:

Write-Host "My message"

Bypass the execution policy for the current user

To execute scripts in a powershell console, use: