Skip to content

Instantly share code, notes, and snippets.

@karol-pawlowski
karol-pawlowski / choco-installer.ps1
Last active July 23, 2020 08:59 — forked from amogram/chocolatey-env-setup.ps1
A Chocolatey script for PowerShell I use to set up my Windows development environment. I use this when setting up my own Dev VMs. Use at your own risk.See http://bit.ly/1a301JK and http://chocolatey.org/ for more information.
# Install Chocolatey and applications
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# Disable confirmations
choco feature enable -n allowGlobalConfirmation
# Running this runs the above
iex ((new-object net.webClient).DownloadString('https://gist.githubusercontent.com/karol1990/4f5455e9fbfb3c8af145b60c084c8ebe/raw/62dfd04b592177a7bfdfee9d787a0ef41882266d/chocolatey-env-setup.ps1'))
@karol-pawlowski
karol-pawlowski / cmder.config.xml
Last active January 10, 2019 09:59
Conemu configuration file
<?xml version="1.0" encoding="utf-8"?>
<key name="Software">
<key name="ConEmu">
<key name=".Vanilla" modified="2019-01-10 10:58:30" build="190108">
<value name="Language" type="string" data="en"/>
<value name="StartType" type="hex" data="02"/>
<value name="CmdLine" type="string" data=""/>
<value name="StartTasksFile" type="string" data=""/>
<value name="StartTasksName" type="string" data="{Shells::PowerShell (Admin)}"/>
<value name="StartFarFolders" type="hex" data="00"/>
.load sos / .loadby sos clr
!help
.time
!threadpool
!runaway - all threads + cpu usage
!threads
~[threadId]s
!clrstack (-p)
!dumpobj 0x3333(address)
rm alias:curl
New-ALias find Get-ChildItem
function touch ([string]$name) {
if($name -match '[^\.]+\.[^$]+') {
New-Item -ItemType File -Name $name
} else {
New-Item -ItemType Directory -Name $name
}
SELECT cp.objtype AS ObjectType,
OBJECT_NAME(st.objectid,st.dbid) AS ObjectName,
cp.usecounts AS ExecutionCount,
st.TEXT AS QueryText,
qp.query_plan AS QueryPlan
FROM sys.dm_exec_cached_plans AS cp
CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) AS qp
CROSS APPLY sys.dm_exec_sql_text(cp.plan_handle) AS st
WHERE OBJECT_NAME(st.objectid,st.dbid) = 'stored_proc_name'
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
using System.Web.Configuration;
using System.Web.Mvc;
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>
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
# 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
Write-Host "Removing local branches that were merged to develop"
git branch --merged | Where { $_ -NotMatch "(^\*|master|develop|help|remote)" } | %{git branch -d $_.Trim()}