Skip to content

Instantly share code, notes, and snippets.

@karol-pawlowski
karol-pawlowski / install-latest-yarn.ps1
Created November 30, 2020 21:48 — forked from FeodorFitsner/install-latest-yarn.ps1
Installing latest Yarn with PowerShell
Write-Host "Installing Yarn..." -ForegroundColor Cyan
Write-Host "Downloading..."
$msiPath = "$env:TEMP\yarn.msi"
(New-Object Net.WebClient).DownloadFile('https://yarnpkg.com/latest.msi', $msiPath)
Write-Host "Installing..."
cmd /c start /wait msiexec /i "$msiPath" /quiet
Write-Host "Yarn installed" -ForegroundColor Green
version: '2.2'
services:
es01:
image: docker.elastic.co/elasticsearch/elasticsearch:7.8.0
container_name: es01
environment:
- node.name=es01
- cluster.name=es-docker-cluster
- discovery.seed_hosts=es02,es03
- cluster.initial_master_nodes=es01
docker stop $(docker ps -aq)
docker rm $(docker ps -aq)
docker rmi $(docker images -q)
Set-NetConnectionProfile -interfacealias "vEthernet (DockerNAT)" -NetworkCategory Private
@karol-pawlowski
karol-pawlowski / .git-commit-template
Created July 9, 2019 14:13 — forked from zakkak/.git-commit-template
This commit message template that helps you write great commit messages and enforce it across your team.
# [<tag>] (If applied, this commit will...) <subject> (Max 72 char)
# |<---- Preferably using up to 50 chars --->|<------------------->|
# Example:
# [feat] Implement automated commit messages
# (Optional) Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# (Optional) Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
Write-Host "Removing remote branches from origin that were merged to develop"
git branch -r --merged | Where { $_ -NotMatch "(^\*|master|develop|help|remote)" } | %{ git push origin --delete $_.Trim().replace('origin/', '')}
Write-Host "Removing local branches that were merged to develop"
git branch --merged | Where { $_ -NotMatch "(^\*|master|develop|help|remote)" } | %{git branch -d $_.Trim()}
# Switch HyperV off
bcdedit /set hypervisorlaunchtype off
#Switch HyperV on
bcdedit /set hypervisorlaunchtype auto
#Above require system reboot but allow quick toggle so switch from HyperV to VirtualBox can be done painless
FROM node:10.6.0-alpine AS build
WORKDIR /src
COPY ${PROJECT_NAME}/package*.json ./
RUN npm install
COPY ${PROJECT_NAME}/ .
RUN npm run build
FROM nginx:alpine
EXPOSE 80
COPY ${PROJECT_NAME}/nginx.conf /etc/nginx/nginx.conf
using System;
using System.Runtime.InteropServices;
namespace ItWorks.Api.Infrastructure
{
public static class UUId
{
/// <summary>
/// This method can be used to retrieve well formed universally unique id. The advantage is, it has no vulnerability what GUID v1 and has good distribution so won't overload SQL Server
/// </summary>