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 / Microsoft.PowerShell_profile.ps1
Created February 9, 2025 19:14
My PowerShell profile
# General modules
Import-Module -Name PSReadLine # typeahead predictions and whatnot
Import-Module -Name Terminal-Icons # Icons when listing directories
Import-Module -Name PSFzf # activate using `Ctrl T`, `Ctrl R` and `Alt C`
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1 # Exposes `refreshenv`
Invoke-Expression (&starship init powershell)
# Advanced completion features (arrow up and down after having started typing)
Set-PSReadLineOption -HistorySearchCursorMovesToEnd
Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
@webbertakken
webbertakken / settings.json
Last active February 10, 2025 01:57
My Windows Terminal config file
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command": {
"action": "globalSummon",
"name": "_quake",
"dropdownDuration": 200,
@webbertakken
webbertakken / starship.toml
Created February 9, 2025 01:22
My terminal prompt configuration for Starship.rs
# Get editor completions based on the config schema
"$schema" = 'https://starship.rs/config-schema.json'
#############
# Notes #
#############
# This config assumes you have a Nerd Font installed and enabled in your terminal.
# I use 'FiraCode Nerd Font Mono', but you should be able to use any Nerd Font you like.
@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 January 23, 2025 05:55
.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 May 2, 2024 10:21
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