Skip to content

Instantly share code, notes, and snippets.

View webbertakken's full-sized avatar
🧙
Learning new things

Webber Takken webbertakken

🧙
Learning new things
View GitHub Profile
@webbertakken
webbertakken / log-docker-digests.sh
Last active April 3, 2024 13:28
Docker digests logger
#!/bin/bash
#
# Unraid Userscript (but should run on any linux distro)
# Log and display latest known use of docker image digests for each image.
#
# Recommended to set as a 5 minute cron (`*/5 * * * *`)
#
# If something goes wrong you can pull the image by digest instead of `latest`
# See: https://docs.docker.com/reference/cli/docker/image/pull/#pull-an-image-by-digest-immutable-identifier
##
@webbertakken
webbertakken / package.json
Last active January 21, 2024 19:56
Definitive cross-platform lint-staged config (explained)
{
// 1. Use these exact dependencies
"devDependencies": {
"husky": "=8.0.3",
"lint-staged": "=13.2.1"
}
// 2. Make sure it installs when people install dependencies
"scripts": {
"prepare": "husky install"
@webbertakken
webbertakken / email-to-discord-worker.js
Created February 21, 2023 22:45
Cloudflare forwarding Email to Discord
// Todo - Replace next line with your own
const DISCORD_WEBHOOK_URL = 'https://discord.com/api/webhooks/YOUR_WEBHOOK_URL';
export default {
async email(message, env, ctx) {
const url = DISCORD_WEBHOOK_URL;
const { from, to } = message;
const subject = message.headers.get('subject') || '(no subject)'
@webbertakken
webbertakken / Docker-Tag-Exists.PS1
Last active January 23, 2022 16:35
Check whether an image exists Dockerhub.
# Check whether a docker image exists on Dockerhub.
#
# Usage:
# if (Docker-Tag-Exists -Repository "unityci/base" -Tag "windows-0.17.0") {
# echo "Image exists."
# } else {
# echo "Image does not exist."
# }
function Docker-Tag-Exists {
[CmdletBinding()]
@webbertakken
webbertakken / .gitattributes
Last active March 19, 2024 17:46
.gitattributes for Unity projects
#
# Git attributes for Unity projects
#
# Compiled by the GameCI community under the MIT license - https://game.ci
#
# Latest version at https://gist.github.com/webbertakken/ff250a0d5e59a8aae961c2e509c07fbc
#
# Ensure that text files that any contributor introduces to the repository have their line endings normalized
* text=auto
@webbertakken
webbertakken / DtoUniqueEntity.php
Last active November 22, 2021 14:35
DataTransferObject-UniqueEntityConstraint
<?php
namespace App\Validator\Constraints;
use Symfony\Component\Validator\Constraint;
/**
* @Annotation
*/
class DtoUniqueEntity extends Constraint
@webbertakken
webbertakken / .editorconfig
Last active January 18, 2022 21:37
Editor configuration to synchronise any modern editor with widely accepted standards for any web project.
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 100
tab_width = 2
@webbertakken
webbertakken / .sass-lint.yml
Created March 8, 2018 16:13
Sass-lint configuration for Symfony 4
##
# Sass-lint configuration using rather strict rules
#
# Rules: https://github.com/sasstools/sass-lint/tree/master/docs/rules
#
# Author: WebberTakken <webber@takken.io>
##
options:
formatter: stylish
merge-default-rules: false
@webbertakken
webbertakken / webpack.config.js
Last active June 26, 2019 13:42
Webpack configuration for Symfony 4 + React + Sass + ES6-proposals
/**
* Webpack configuration.
*
* @requires composer-package:symfony/flex
* @requires composer-recipe:encore
*
* @requires module:babel-preset-env
* @requires module:babel-preset-es2015
* @requires module:babel-preset-react
* @requires module:babel-preset-stage-0