All New

user:thomas gists created by user

title:mygist gists with given title

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

Register

Login


All New Register Login

All gists

Recently created
Least recently created
Recently updated
Least recently updated
Korbs's Avatar

Korbs / 44a1730be2514820bcf4d58af54b1a23

0 likes
0 forks
1 files
Last active 1 week ago
1 ---
2 // Request Data
3 const Teams = await fetch('https://example.org/data.json').then((response) => response.json())
4 ---
5
6 <!-- Map JSON Data -->
7 {Teams.map((team) =>
8 {
9 <div class="team">
10 <h2>{team.name}</h2>
Korbs's Avatar

Korbs / 24f283e831b14a9b85b9dd1f76cc4ec6

0 likes
0 forks
3 files
Last active 1 week ago
1 'use strict';
2
3 var cacheVersion = 1;
4 var currentCache = {
5 offline: 'offline-cache' + cacheVersion
6 };
7 const offlineUrl = 'offline.html';
8
9 this.addEventListener('install', event => {
10 event.waitUntil(
Korbs's Avatar

Korbs / 9d8c050b9781475d8dbfc4398adabc72

0 likes
0 forks
3 files
Last active 1 week ago
1 <div include-html="./component.html"></div>
2 <script>includeHTML()</script>
Korbs's Avatar

Korbs / 6a076197ba074b1ea05ef39e05c241c6

0 likes
0 forks
1 files
Last active 1 week ago

SudoVanilla Ark and Commit Signing

Sign commits when pushing to SudoVanilla Ark and other Forgejo/Gitea instances.

Generate SSH Key

Generate a new SSH key using the ssh-keygen key. We'll name it ark so we know in the future that this key is used for SudoVanilla Ark or whatever you originally planned to use it for.

Run:

ssh-keygen -o -f ~/.ssh/ark -a 100 -b 4096 -C "KeyName"
Korbs's Avatar

Korbs / 4da296253b454d13b8b68ea7c97477f0

0 likes
0 forks
1 files
Last active 1 week ago

Selfhosting Minecraft Java Server

Getting around to selfhosting your own Minecraft Java server has it's perks and gives you full control of your server's data, it's also much more affordable compared to using a SaaS.

If you have a spare machine laying around that is no longer in use, it would be re-purposed as a Minecraft server.

Hardware Requirements

For the piece of hardware you'll be using to host the server on, you want to make sure you know it can handle it. For your CPU, it should at least have 4 or more cores over 2GHz. 4GB - 8GB or more RAM(Memory), this also varies how much you add to the server like the amount of players connecting or the many plugins or mods you add. For disk space, I make sure you have at least 8GB or more, this also varies like it does with RAM.

Korbs's Avatar

Korbs / 4c79b17045f54bea96e53bb83cd1db60

0 likes
0 forks
1 files
Last active 1 week ago

Enable Catch-All in Mailcow

Setup a domain first in E-Mail > Configuration > Domain > Domain. Then, once the domain is setup, create an alias that you'll use, go to Alias > Alias.

Create an alias like casper@example.org, then we can setup the catch-all next.

To create an catch-all event, simply just use your domain for an alias. So create an alias called @example.org and set the Goto address to something like casper@example.org.

Korbs's Avatar

Korbs / 4a1b1f2a0a59485fb950fb0469affc09

0 likes
0 forks
4 files
Last active 1 week ago
1 worker_processes 1;
2 events {
3 worker_connections 1024;
4 }
5 http {
6 upstream lemmy {
7 server "lemmy:8536";
8 }
9 upstream lemmy-ui {
10 server "lemmy-ui:1234";
Korbs's Avatar

Korbs / 3ebf2984005d4207bbb98c5e221aa678

0 likes
0 forks
1 files
Last active 1 week ago

Web Tricks and Methods

HTML

Number Keyboard for Mobile Devices

When it comes to creating a number input, we would create an <input/> with the type attribute set to number. This makes arrow buttons show up that can let us go up and down.

On mobile, we don't want this. It's expected by the end-user that their numberic keyboard shows up, so we set the inputmode instead.

Korbs's Avatar

Korbs / Fallback Native Player for NonJS users

0 likes
0 forks
1 files
Last active 2 days ago

When building a custom video player, it will likely not work for end-users that have decided to disable JavaScript in their web browser. To get around this, it's best to add a fallback that'll allow them to switch over to the web browser's native player.

To pull this off, we'll take advantage of the HTML tag known as details and noscript.

Detect JavaScript is Disabled

First, we need to tell if JavaScript is disabled, we can use the noscript tag. Anything used within a noscript tag is shown if JavaScript is not present.

<noscript>If you're seeing this, JavaScript is not enabled.</noscript>
Korbs's Avatar

Korbs / 2e7daad1c7544aadb072977ac6ac69ad

0 likes
0 forks
1 files
Last active 1 week ago

During the day, I happen to switch between my speakers and headphones quite a bit. I've recently decided to setup custom shortcuts to switch quickly between them without needing to open the volume menu in GNOME or KDE.

Install

Firstly, the pactl tool is used for this, please install it:

sudo dnf install pactl
Newer Older

Powered by Opengist ⋅ Load: 128ms⋅

English
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文