Skip to content

Instantly share code, notes, and snippets.

View AlexanderHentzsch's full-sized avatar

Alexander Hentzsch AlexanderHentzsch

  • CEC Projekt GmbH
  • Alt Dellnau 4, 06842 Dessau-Roßlau
View GitHub Profile
@AlexanderHentzsch
AlexanderHentzsch / update_portainer.win.sh
Last active January 12, 2024 10:14
Update Portainer unter Windows
@echo off
chcp 65001 > nul
setlocal enabledelayedexpansion
set /p backup="Haben Sie ein Backup gemacht? (ja/nein): "
for %%i in ("ja" "j" "yes" "y" "1") do (
if /i "%backup%"==%%i (
@AlexanderHentzsch
AlexanderHentzsch / vuex-template.js
Created April 8, 2022 06:45
Template für den vuex/nuxt $store
export const state = () => ({
__default: '',
});
export const getters = {
_default(state) {
return state;
},
_withParams: (state) => (param) => {
},
@AlexanderHentzsch
AlexanderHentzsch / child.vue
Created May 21, 2021 10:03
Vue.js: Verwendung von v-model auf components
<template>
<div>
<v-text-field v-model="test"></v-text-field>
</div>
</template>
<script>
export default {
name: "child",
props: {
export const state = () => ({
$KEY: '$VALUE'
})
export const getters = {
get_$KEY(state) {
return state.$KEY;
},
};
<i18n lang=yaml>
de:
keyname: Value
en:
keyname: Value
</i18n>
<template>
<div>
#[[$END$]]#
@AlexanderHentzsch
AlexanderHentzsch / axiosRequest.js
Created October 26, 2020 16:30
Axios extension class for vuejs
import axios from 'axios';
let t;
export default class AxiosRequest {
constructor(url, requestMethod = 'GET', timeoutSeconds = 3, preload = false) {
this.successData = null;
this.errorMessage = null;
this.isCancel = false;
@AlexanderHentzsch
AlexanderHentzsch / index.html
Created June 3, 2020 15:07
Usage of bit operators for function selection
<!DOCTYPE html>
<html>
<head>
<title>JS Bitwise Operators</title>
<meta charset="UTF-8" />
</head>
<body>
<div id="app"></div>
@AlexanderHentzsch
AlexanderHentzsch / usefull.md
Last active October 7, 2021 14:34
Sammlung von Informationen und Websites

Windows 10: Programm zum Autostart hinzufügen

WIN + R --> shell:startup

Icons für Website generieren lassen

https://realfavicongenerator.net/

RegEx

\[.{28}\] ... eckige Klammern umschließen 28 Zeichen
\[.*\] ... eckige Klammern umschließen eine unbestimmte Anzahl an Zeichen
/** Format: DD-MM-2YYY HH:MM **/
const isDateValid = (value) => {
const isSpellingValid = (value) => {
/** Only for dates older than 2000 **/
const regExpString = /([012][0-9]|3[0-1])\.(0[1-9]|1[0-2])\.2([0-9]{3}) (0[0-9]|1[0-9]|2[0-3]):([0-5][0-9])/;
let matchResult = value.match(regExpString);
return matchResult[0] === matchResult.input;
};
const isDateStringValid = (value) => {
function write_array($arr)
{
if (!is_array($arr)) {
return "Kein Array.";
}
$out = [];
foreach ($arr as $key => $value) {
$str = "[$key] $value";
array_push($out, $str);