mysql --user=my_username --password
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
import * as child_process from 'child_process' | |
/** | |
* Executes a shell command and return it as a Promise. | |
*/ | |
export function exec(cmd: string): Promise<string> { | |
return new Promise((resolve, reject) => { | |
child_process.exec(cmd, (error, stdout, stderr) => { | |
if (error) { | |
reject({ error: error, stderr: stderr }); |
<?php | |
$default_info = | |
"<br><b>Persönliche Daten</b><br>" | |
."<b>Name:</b> Detlef Dummy<br>"; | |
$TOKEN = "superSecretToken"; | |
$code = $_GET["code"]; | |
$name = $_GET["name"]; |
/** | |
* Formats a date as string specified by a template string | |
* @param date Date to be formatted | |
* @param templateString Template of the expected format. e.g. "YYYY-MM-DD hh:mm:ss" or "YY-M-D h:m:s" to trim leading zeros | |
*/ | |
export function formatDate(date: Date, templateString: string): string { | |
const year = date.getFullYear().toString(); | |
const shortYear = date.getFullYear().toString().substr(2, 2); | |
const month = date.getMonth() < 9 ? "0" + String(date.getMonth() + 1) : String(date.getMonth() + 1); | |
const shortMonth = String(date.getMonth() + 1); |
Install theese two extensions:
Use the format-html-in-php
to format the html snippets and phpfmt
to format the php snippets
Note: This solution is really not perfect. If anyone knows a simpler way, feel free to write a comment!
Guide to install a LAMP system on on your archlinux system and serve php-based database applications.
LAMP stands for a Linux system with Apache (webserver), MariaDB (database) and PHP (programming language). In this guide we will also install PhpMyAdmin (database admin GUI) to easily manage the SQL tables.
The Apache HTTP Server is an open-source and free product of the Apache Software Foundation and one of the most widely used web servers on the Internet. In addition to factors such as performance, expandability, security, freedom from license costs and support from a very large community, its long-term availability for a wide variety of operating systems is one of the reasons for its widespread use; it is most frequently used as a LAMP system.
(Archlinux in my case)
Reset all settings and extensions. Like a fresh and clean VSCode installation.
~/.vscode-oss
folder and the ~/.config/Code - OSS/
folder
~
is a shorthand for your user folder/home/username
but should work on all unix systems
WARNING: This will remove all your settings and installed extensions without any prompt
#scan local network for clients | |
sudo arp-scan --interface=enp4s0 --localnet | |
#live monitoring of network traffic and datavolume | |
nload |
Defined in RFC2445
Nice to read on https://www.kanzaki.com/docs/ical/
Allways start file with BEGIN:VCALENDAR
and end with END:VCALENDAR
Events allways start with BEGIN:VEVENT
and end with END:VEVENT
and are nested in VCALENDAR
Timezones are mandatory for recurring events and recommended for all events.