Skip to content

Instantly share code, notes, and snippets.

View exkuretrol's full-sized avatar
😾
Focusing

Chiawei Chen exkuretrol

😾
Focusing
View GitHub Profile
@bramus
bramus / .htaccess
Last active November 10, 2023 20:20
URL Rewriting for Apache (requires mod_rewrite) and IIS (requires IIS url rewrite module)
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
@dotStart
dotStart / MinecraftService.md
Last active March 28, 2024 12:39
Systemd services for Minecraft Servers

Minecraft systemd Services

This gist contains service descriptors which may be used to automatically start and re-start Minecraft servers using systemd. This allows proper control of your server startup on modern Linux distributions and will automatically manage all required tasks on startup for you.

Requirements

@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active July 23, 2024 10:19
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@OHua
OHua / LANGUAGE_CODE.md
Created December 14, 2017 07:49
[Django 設定 LANGUAGE_CODE 時所遇到的麻煩] OSError: No translation files found for default language zh-TW.

今天想說重新 review 一次目前所學的 Django 內容 就新開了一個資料夾並且從頭來過 一模一樣的重建一次藉此來複習並熟練

結果在 migrate 的階段噴出錯誤說找不到 zh-TW

OSError: No translation files found for default language zh-TW.

我立刻打開 settings.py 看了看感覺我的設置沒甚麼錯誤阿

@bebosudo
bebosudo / django_custom_widget.md
Last active January 25, 2024 02:48
Custom django form widget with no pain.

First of all, edit your_app_settings/settings.py and add:

INSTALLED_APPS = [
    'django.forms',  # to let django discover the built-in widgets
    ...
]

FORM_RENDERER = 'django.forms.renderers.TemplatesSetting'
@Treeki
Treeki / TurnipPrices.cpp
Last active July 8, 2024 02:08
AC:NH turnip price calculator
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
// munged from https://github.com/simontime/Resead
namespace sead
{
class Random
{
@maxrodrigo
maxrodrigo / details.html
Created April 29, 2020 16:01
Details disclosure and summary elements hugo shortcode.
{{ .Scratch.Set "lastp" (sub (.Params | len) 1) }}
<details {{ if .Get 0 | eq "open"}} open {{ end }}>
<summary>
{{ .Get (.Scratch.Get "lastp") }}
</summary>
{{ .Inner | markdownify }}
</details>
@tjtanjin
tjtanjin / minecraft_server_guide.md
Last active June 18, 2022 16:41
Setup Minecraft Server on Ubuntu 18.04/20.04

How to create a minecraft server on Ubuntu (18.04/20.04)

Introduction

This is a generic minecraft server setup guide that has been tested on Ubuntu 18.04 and 20.04. By the end of this guide, you will have your very own multiplayer minecraft server that you and your friends (or anyone for that matter) can join and have fun on!

Server Setup

To begin, you will need to provision a VPS from cloud providers such as digitalocean or upcloud. Other popular services like AWS and google cloud would work as well with their EC2 and compute instances but the nature of those services are such that they are slightly more complicated to work with so they will not be included in this guide.

Once you have your VPS provisioned, SSH into your server with the following command (replacing 11.11.11.11 with your server's IP address):

ssh root@11.11.11.11

@ryan-blunden
ryan-blunden / .env
Last active May 16, 2024 05:54
Python Application Config and Secrets Class
API_KEY="357A70FF-BFAA-4C6A-8289-9831DDFB2D3D"
HOSTNAME="0.0.0.0"
PORT="8080"
# Optional
# DEBUG="True"
# ENV="development"
@djibe
djibe / hugo-shortcode-table.html
Last active January 26, 2023 15:03
Hugo static site ultimate table shortcode
{{ $htmlTable := .Inner | markdownify }}
{{ $old := "<table>" }}
{{ $new := "" }}
{{ $title := .Get "title" }}
{{ $extraClass := .Get "class" }}
{{ $id := "" }}
{{ with .Get "id" }}
{{ $id = . }}
{{ else }}
{{ $id = delimit (shuffle (seq 1 9)) "" }}