Skip to content

Instantly share code, notes, and snippets.

@zeromancer
zeromancer / caddy.sh
Created May 17, 2018 19:34
unused caddy + docker config
# Caddy - Configuration
touch /var/log/caddy.log
chown http /var/log/caddy*
mkdir -p /opt/caddy/ssl
cat >/opt/caddy/Caddyfile <<EOF
https://$SERVER_NAME.$DOMAIN:4443 {
root /srv
log /var/log/caddy.log
# Sensible Bash - An attempt at saner Bash defaults
# Maintainer: mrzool <http://mrzool.cc>
# Repository: https://github.com/mrzool/bash-sensible
# Version: 0.2.1
## GENERAL OPTIONS ##
# Prevent file overwrite on stdout redirection
# Use `>|` to force redirection to an existing file
set -o noclobber
---
# Site specific Streisand configuration.
#
# This file is mutated by the playbooks/customize.yml tasks when a user chooses
# to customize which Streisand services are installed.
# The SSH private key that Ansible will use to connect to the Streisand node.
# The associated public key will be used if required when provisioning cloud
# nodes for the authorized_keys file.
streisand_ssh_private_key: "~/.ssh/id_rsa"
[Profile]
WheelScrollLines=4
MouseSensitivity=3
DoubleClickSpeed=5
UniversalScrollEnabled=0
AccelerationEnabled=1
XYSensitivityEnabled=0
MouseSpeedX=10
MouseSpeedY=10
OFASensitivity=10
const fs = require("fs");
const pathRegex = /\sd="(.*)"/;
const basePath = `./icons/svg`;
const svgFiles = fs.readdirSync(basePath);
for (let svgFile of svgFiles) {
const name = svgFile
.split(/-/g)
.map(part => {
@zeromancer
zeromancer / ControllerExceptionHandlingConfiguration.java
Created December 6, 2017 15:38
Custom exception handling for Spring Boot
import java.io.IOException;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.Map;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
@zeromancer
zeromancer / watch_convert_dir.sh
Last active December 26, 2017 18:37
Automatically processes all images in a folder to svg by reproducing the image with triangles
#!/bin/bash
set -x ## Print all executed commands to the terminal
set -e ## Exit immediately if a command exits with a non-zero status
# Example usage
# download/install https://github.com/fogleman/primitive
# cd ~/Develop/Go
# mkdir -p n100 n100/n100_src n100/n100_dst
# ./watch_convert_dir.sh n100 n100/n100_src n100/n100_dst 100 -r 64 bg #000000
# ./watch_convert_dir.sh n200 n200/n200_src n200/n200_dst 200 -m 0
{
"defaultSeverity": "warning",
"extends": [
"tslint:recommended"
],
"jsRules": {},
"rules": {
"arrow-parens": false,
"no-var-requires": false,
"no-console": [false, "log", "error", "info"],
{
"compilerOptions": {
"target": "ES2017",
"outDir": "build",
"declaration": true,
"rootDir": "src",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"experimentalDecorators": true,
// Place your key bindings in this file to overwrite the defaults
[{
"key": "f3",
"command": "editor.action.goToDeclaration",
"when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor"
},
{
"key": "ctrl+f5",
"command": "workbench.action.reloadWindow",
"when": "editorTextFocus"