Skip to content

Instantly share code, notes, and snippets.

View dioncodes's full-sized avatar

Dion dioncodes

View GitHub Profile
@dioncodes
dioncodes / server-status-widget.js
Last active November 4, 2024 11:04
Scriptable iOS Server Status Widget
const initialData = {
servers: [
{
url: 'https://1.example.com/',
title: 'Server 1',
online: null,
},
{
url: 'https://2.example.com/',
title: 'Server 2',
@dioncodes
dioncodes / example-backend.service
Created September 1, 2022 21:12
Gin Go Backend System Service
[Unit]
Description=example-backend
[Service]
Type=simple
Restart=always
RestartSec=5s
ExecStart=/path/to/example/example-backend-linux-amd64
WorkingDirectory=/path/to/example
Environment="GIN_MODE=release"
@dioncodes
dioncodes / SvgIcon.vue
Created June 23, 2022 13:20
Vue Inline SVG Wrapper
<template>
<inline-svg
:src="require(`@/assets/svg/${name}.svg`)"
:width="width || size || null"
:height="height || size || null"
:style="{ fill: color || undefined, stroke: strokeColor || undefined }"
/>
</template>
<script lang="ts">
@dioncodes
dioncodes / Semantic-Commit-Messages.md
Created February 18, 2022 14:56
Extended 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

@dioncodes
dioncodes / db-backup-exec.sh
Last active February 19, 2021 17:22
Automatic AWS Database Backup
#!/usr/bin/env bash
AWS_ACCESS_KEY_ID="ABC" \
AWS_SECRET_ACCESS_KEY="ABC123" \
AWS_DEFAULT_REGION="eu-central-1" \
S3_BUCKET="example-bucket" \
MYSQL_HOST="127.0.0.1" \
MYSQL_PORT=3306 \
MYSQL_DB="mysql_db" \
MYSQL_USER="mysql_user" \
MYSQL_PASS="mysql_pw" \
@dioncodes
dioncodes / gulpfile.js
Last active July 3, 2020 12:39
npm + gulp for scss and js minifying
var gulp = require('gulp');
var sass = require('gulp-sass');
// var sourcemaps = require('gulp-sourcemaps');
var postcss = require('gulp-postcss');
var babel = require('gulp-babel');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
function style(path, dest) {
return (
@dioncodes
dioncodes / config.yml
Created April 25, 2019 11:11
German config.yml
# Shop Plugin by Dion Purushotham
# Copyright (c) 2019 drpdev.de
# Minecraft Server: mineopolis.de
prefix: '&6[Shop]'
messages:
notFound: '&4Leider wurde dieser Gegenstand nicht gefunden oder steht nicht zum
Verkauf.'
noPermission: '&4Du hast dafür keine Berechtigung.'
noValidCount: '&4Bitte gib eine gültige Anzahl ein. &6/buy <id/name> <anzahl>'
@dioncodes
dioncodes / binarytodecimal.cpp
Created January 30, 2012 09:32
binary to decimal
int binarytodecimal() {
string eingabe;
int ergebnis;
cout << "Enter a binary number (0-1): ";
cin >> eingabe;
int zahl;
string zahlk, zahls;
for(int i=eingabe.length(), multi=1;i>=0;i--,multi*=2) {
zahlk = eingabe[i];
zahl = atoi(zahlk.c_str());
@dioncodes
dioncodes / gist:1433112
Created December 5, 2011 10:13
A simple programm to convert decimal to binary numbers
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
int decimaltobinary() {
string ergebnis;
int erg;
int eingabe;