Single-node, custom universal solution, right from a plain bare-metal server or VPS.
Ubuntu 18+ (All the steps below was made on a DigitalOcean $5 Droplet)
#!/usr/bin/python | |
import sys | |
from random import randint | |
emojiList = [ | |
":art:", | |
":zap:", | |
":fire:", | |
":bug:", | |
":ambulance:", |
<# | |
.Synopsis | |
Exports environment variable from the .env file to the current process. | |
.Description | |
This function looks for .env file in the current directoty, if present | |
it loads the environment variable mentioned in the file to the current process. | |
based on https://github.com/rajivharris/Set-PsEnv |
So, I decided to write a little thing, only to practice writing, it's about SOLID being compared between class-based-OO and FP, and there will be grammar errors and there will be a lot of formatting errors, 'bear' with me as I type this as fast as I can. Also correct if I'm wrong. Warning, wall of text in English.
" a class should have only a single responsibility "
A pure function is something with a single responsibility, turning its input into an output. What could be simpler?.
DROP FUNCTION IF EXISTS fn_remove_accents; | |
DELIMITER | | |
CREATE FUNCTION fn_remove_accents( textvalue VARCHAR(10000) ) RETURNS VARCHAR(10000) | |
BEGIN | |
SET @textvalue = textvalue COLLATE utf8_general_ci;; | |
-- ACCENTS | |
SET @withaccents = 'ŠšŽžÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝŸÞàáâãäåæçèéêëìíîïñòóôõöøùúûüýÿþƒ'; |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
package main | |
import ( | |
"encoding/json" | |
"net/http" | |
"github.com/graphql-go/graphql" | |
"github.com/graphql-go/handler" | |
"github.com/graphql-go/relay/examples/starwars" | |
) |