Skip to content

Instantly share code, notes, and snippets.

@jgrahamc
jgrahamc / pwnd.js
Created February 24, 2018 16:36
Cloudflare Workers that adds an "Cf-Password-Pwnd" header to a POST request indicating whether the 'password' field appears in Troy Hunt's database of pwned passwords.
addEventListener('fetch', event => {
event.respondWith(fetchAndCheckPassword(event.request))
})
async function fetchAndCheckPassword(req) {
if (req.method == "POST") {
try {
const post = await req.formData();
const pwd = post.get('password')
const enc = new TextEncoder("utf-8").encode(pwd)
@zaphodtx
zaphodtx / boxstarter.ps1
Last active March 24, 2018 02:09 — forked from jessfraz/boxstarter.ps1
Boxstarter commands for a new hyper-V Dev instance
# Description: Boxstarter Script
# Author: Jess Frazelle <[email protected]>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@zaphodtx
zaphodtx / boxstarterSetupAndRun
Created May 21, 2018 03:52
Boxstarter setup and run. Commands to copy and paste into and Admin PowerShell.
# Enable running any PowerShell scripts - select 'A'
Set-ExecutionPolicy Bypass
# Install Chocolatey
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# install boxstarter - reopen powerShell after installation of boxstarter
choco install boxstarter -y
# run boxstarter with gist - customize URL for different gist.
@willwm
willwm / nvm.sh
Last active July 19, 2020 04:40
Install nvm
# Install nvm:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
# Configure nvm shell context:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# Install Node.js via nvm:
nvm install node