Skip to content

Instantly share code, notes, and snippets.

Niels Hofmans hazcod

Block or report user

Report or block hazcod

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hazcod
hazcod / wgcf.sh
Created Oct 16, 2019
Connect to Cloudflare Warp from macOS.
View wgcf.sh
#!/usr/bin/env bash
set -euo pipefail
shopt -s inherit_errexit 2>/dev/null || true
# this script will connect macOS to Cloudflare Warp using Wireguard
# note: this is *absolutely not* an official client from Cloudflare
# Copyright (C) 2019 Jay Freeman (saurik)
# Zero Clause BSD license {{{
@hazcod
hazcod / gumball.sh
Created Oct 3, 2019
Download Gumball dutch episodes.
View gumball.sh
#!/bin/sh
youtube-dl --match-title 'Volledige\sAflevering' \
--output "~/Desktop/%(title)s.%(ext)s" \
https://www.youtube.com/playlist?list=PL-AMfRCN-wkrIC7mps3rmJJU1PmcDY15X
View docker-swarm-security-groups.tf
locals {
instanceTcpPorts = ["${var.ssh_port}", 80, 433, 7946]
instanceUdpPorts = [7946, 4789]
managerTcpPorts = ["${var.ssh_port}", 80, 433, 2377, 7946]
managerUdpPorts = [7946, 4789]
}
resource "scaleway_security_group" "swarm_instance" {
name = "swarm_instances"
@hazcod
hazcod / cloudSettings
Last active Nov 13, 2019
My VS Code preferences.
View cloudSettings
{"lastUpload":"2019-11-13T19:47:45.597Z","extensionVersion":"v3.4.3"}
@hazcod
hazcod / cloudbuild.yaml
Last active Oct 15, 2019
Clean container registry images in Google Cloud Build step.
View cloudbuild.yaml
substitutions:
_IMG_KEEP: "3"
steps:
- name: 'gcr.io/cloud-builders/gcloud-slim'
entrypoint: 'bash'
args:
- '-c'
@hazcod
hazcod / go-alpine-protobuf.Dockerfile
Last active Jun 24, 2019
Use protobuf on golang alpine Docker image.
View go-alpine-protobuf.Dockerfile
FROM golang:alpine
RUN apk add --no-cache protobuf git \
&& go get github.com/golang/protobuf/protoc-gen-go \
&& cp /go/bin/protoc-gen-go /usr/bin/
# e.g. find proto -type f -iname '*.proto' -exec protoc -I proto/ --go_out go/ {} \;
@hazcod
hazcod / remove-map-refs.sh
Last active May 13, 2019
Remove mapping file references using (bsd) sed and find.
View remove-map-refs.sh
find css js -type f \( -iname '*.css' -o -iname '*.js' \) -exec sed -i '' -e 's/sourceMappingURL=[^ ]*\.map//g' {} +
@hazcod
hazcod / genpass.sh
Created Feb 5, 2019
Bash snippet to generate a 32-character password with strong entropy.
View genpass.sh
#!/usr/bin/env sh
LC_ALL=C tr -dc 'A-Za-z0-9!"#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~' < /dev/urandom | head -c 32 ; echo
@hazcod
hazcod / btt-work.bttpreset
Created Aug 30, 2018
My BetterTouchTool TouchBar config.
View btt-work.bttpreset
{
"BTTPresetName" : "work",
"BTTGeneralSettings" : {
"disableScrollingIf3" : true,
"BTTForceNormalClickPressure5F" : 200,
"disableScrollingIf2" : true,
"BTTDidRegisterForUpdateStats" : "2.608",
"BTTShowControlStrip" : false,
"BTTShowControlStripItem" : true,
"BTTForceForceClickPressure5F" : 600,
@hazcod
hazcod / feature-policy
Created Aug 24, 2018
Full Feature-Policy header
View feature-policy
Feature-Policy "accelerometer 'none'; ambient-light-sensor 'none'; animations 'none'; autoplay 'none'; camera 'none'; encrypted-media 'none'; fullscreen 'none'; geolocation 'none'; gyroscope 'none'; image-compression 'none'; legacy-image-formats 'none'; magnetometer 'none'; max-downscaling-image 'none'; microphone 'none'; midi 'none'; payment 'none'; picture-in-picture 'none'; speaker 'none'; sync-xhr 'none'; unsized-media 'none'; usb 'none'; vertical-scroll 'none'; vr 'none'";
You can’t perform that action at this time.