Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Dion dioncodes

🏠
Working from home
View GitHub Profile
@dioncodes
dioncodes / example-backend.service
Created Sep 1, 2022
Gin Go Backend System Service
View example-backend.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 Jun 23, 2022
Vue Inline SVG Wrapper
View SvgIcon.vue
<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 Feb 18, 2022
Extended Semantic Commit Messages
View Semantic-Commit-Messages.md

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 Feb 19, 2021
Automatic AWS Database Backup
View db-backup-exec.sh
#!/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 / server-status-widget.js
Last active Apr 19, 2022
Scriptable iOS Server Status Widget
View server-status-widget.js
const initialData = {
servers: [
{
url: 'https://1.example.com/',
title: 'Server 1',
online: null,
},
{
url: 'https://2.example.com/',
title: 'Server 2',
@dioncodes
dioncodes / gulpfile.js
Last active Jul 3, 2020
npm + gulp for scss and js minifying
View gulpfile.js
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 Apr 25, 2019
German config.yml
View 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>'
View binarytodecimal.cpp
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 Dec 5, 2011
A simple programm to convert decimal to binary numbers
View gist:1433112
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
int decimaltobinary() {
string ergebnis;
int erg;
int eingabe;