Skip to content

Instantly share code, notes, and snippets.

View ediblecode's full-sized avatar

Ian Routledge ediblecode

View GitHub Profile
@ediblecode
ediblecode / gist:1bbf83f67de795a7b5611bebb976bf9f
Created June 21, 2016 07:52
Stop and remove all Docker containers
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
@ediblecode
ediblecode / get-all-modules.ps1
Last active June 27, 2016 10:16
List of available PowerShell modules
Get-Module -ListAvailable | Format-Table Name, Description
@ediblecode
ediblecode / setup-site.ps1
Last active September 3, 2018 10:44
Creates a host entry, App Pool and Site in IIS and sets required permissions on the folder. Useful for local dev on a .NET app hosted within IIS.
#requires -version 5
$siteHost = "perflocal"
$siteName = "PerformanceDashboard"
$appPoolName = "PerformanceDashboard"
####################
# INSTALL AND IMPORT CARBON
if (Get-Module -ListAvailable -Name Carbon) {
@ediblecode
ediblecode / npm-global-list
Created July 5, 2016 08:11
Lists out globally installed NPM packages, with their version
npm list -g --depth=0
@ediblecode
ediblecode / common-docker-commands.sh
Last active October 4, 2023 01:52
Common docker commands
# If the commands fail on Windows, then make sure you're running in GitBash/Cygwin and NOT cmd
# HELP!
docker --help
# List docker images
docker images
# List running containers
docker ps
@ediblecode
ediblecode / update-outdated-npm-packages.sh
Created August 25, 2016 08:15
Update all outdated NPM packages
# https://github.com/npm/npm/issues/3417#issuecomment-76363431
npm outdated --depth=0 | grep -v Package | awk '{print $1}' | xargs -I% npm install %@latest --save
@ediblecode
ediblecode / simple-web-server.py
Created September 27, 2016 15:09
SImple web server with python
python -m SimpleHTTPServer 8000
@ediblecode
ediblecode / stop-viewing-all-databases.sql
Created December 15, 2016 08:30
Stop viewing all databases in SSMS
USE MASTER
GO
DENY VIEW ANY DATABASE TO PUBLIC
GO
@ediblecode
ediblecode / html5-template.html
Created August 23, 2017 07:15
HTML Basic Template
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Title here</title>
<meta name="description" content="Description here">
<link rel="stylesheet" href="/css/styles.css">
@ediblecode
ediblecode / package-json-build-number.ps1
Created August 23, 2017 07:22
Powershell script to parse a package.json version and use as the build number in TeamCity
$version = (Get-Content package.json) -join "`n" | ConvertFrom-Json | Select -ExpandProperty "version"
$buildCounter = "%build.counter%"
$buildNumber = "$version.$buildCounter"
Write-Host "##teamcity[buildNumber '$buildNumber']"