Skip to content

Instantly share code, notes, and snippets.

View maxfunke's full-sized avatar
🦀

Baron GitGit maxfunke

🦀
View GitHub Profile
@maxfunke
maxfunke / git_commitGraph.md
Created January 18, 2019 09:54
Speed up git (prompt)

enable commit graph feature git config core.commitGraph true

Now you have to recreate the graph file update commit-graph

git show-ref -s | git commit-graph write --stdin-commits

<#
.SYNOPSIS
Finds all test .dlls and adds them to a code coverage run.
Generates a code coverage report.
.EXAMPLE
"ExecuteCodeCoverage.ps1 -testDllDir . -reportOutDir .\report -reportOutFormat html -testRunnerDir ."
All arguments are optional. Should work like magic.
#>
param (
@maxfunke
maxfunke / multistage.Dockerfile
Created January 11, 2019 20:46
multistage dockerfile
# Multistage build
FROM golang:alpine as build
## stage1: build app, make use of /go/src
RUN mkdir /go/src/app
WORKDIR /go/src/app
ADD ./src/main.go /go/src/app
RUN go build -o /bin/app
@maxfunke
maxfunke / ChangeSoftwareVersion.ps1
Created January 11, 2019 20:45
changes version number in c# project files and SharedAssemblyInfo
<#
.SYNOPSIS
Update Software Version.
.DESCRIPTION
Finds SharedAssemblyInfo.cs in the solution and installer script in deployment directory.
Replaces code parts that define the software version in those files.
.EXAMPLE
"ChangeSoftwareVersion.ps1 -LocalPath . -Version 0.99.99"
.PARAMETER LocalPath
The path to the branch, with the installer script and SharedAssemblyInfo, which contain the software version.
@maxfunke
maxfunke / getLoginsFromEventlog.ps1
Created November 12, 2018 08:09
logins fetched from windows eventlog, filtered
Get-EventLog -LogName System -Source Microsoft-Windows-Winlogon -After (Get-Date).AddDays(-7) | where {$_.InstanceId -eq 7001}
@maxfunke
maxfunke / goBuilds_osDependent.md
Last active November 11, 2018 09:37
Golang build target OS dependent tools
  1. Naming file with build restriction foo_${GOOS}.go

  2. Adding build directives to the top of the file //+build linux,386 darwin windows

  3. on build system set $GOOS variable to target system (no matter which OS is your build system linux<>windows) GOOS = windows go build main.go

  4. cpu architecture can be set

@maxfunke
maxfunke / Dockerfile
Created July 3, 2018 10:23
Golang - multistage docker images
# Multistage build
FROM golang:alpine as build
## stage1: build app, make use of /go/src
RUN mkdir /go/src/app
WORKDIR /go/src/app
## copy sources to build-image
ADD ./src/main.go /go/src/app
RUN go build -o /bin/app
@maxfunke
maxfunke / Boilerpalte.ps1
Created July 3, 2018 10:05
Boilerplate for powershell scripts
#Requires -Version 3
<#
.SYNOPSIS
<Overview of script>
.DESCRIPTION
<Brief description of script>
.PARAMETER <Parameter_Name>
<Brief description of parameter input required. Repeat this attribute if required>
.INPUTS
<Inputs if any, otherwise state None>
@maxfunke
maxfunke / PowershellBasics.md
Last active April 27, 2020 15:45
Basics for Powershell. From Pluralsight course.

Powershell Essentials

📝 ps1 boilerplate

Gather information for cmdlets and functions

Basically all cmdlets look like so: verb-noun

Basic process of information gathering

@maxfunke
maxfunke / javascript.json
Created March 22, 2018 18:05
VSCode Snippets for Jest testing
{
"jest_test_boilerplate": {
"prefix": "test_jest",
"body": [
"test(\"$1\", ($2) => {",
"\t$3",
"});"
],
"description": "basic boilerplate for a jest test case"
},