Skip to content

Instantly share code, notes, and snippets.

View SoftCreatR's full-sized avatar
👻
Boo!

Sascha Greuel SoftCreatR

👻
Boo!
  • Gladbeck, Germany
  • 08:09 (UTC +01:00)
View GitHub Profile
@SoftCreatR
SoftCreatR / blurhash.js
Last active November 10, 2023 13:10
Strapi 4 Blurhash
View blurhash.js
// ./src/extensions/blurhash.js
const plaiceholder = require('plaiceholder')
const _ = require('lodash')
module.exports = {
generatePlaceholder (strapi) {
strapi.contentType('plugin::upload.file').attributes.placeholder = {
type: 'text'
}
@SoftCreatR
SoftCreatR / README.md
Last active February 13, 2023 09:11
RFC 2822 Regex PHP example
View README.md

EmailValidator Class

The ScEmailValidator class provides a static method for validating email addresses using a regular expression.

The regular expression used by this class is based on the pattern defined in RFC 2822 for email addresses. The regular expression is designed to match a wide range of valid email addresses, including email addresses with domain names that contain IP addresses, internationalized domain names (IDNs), and new top-level domain names. The regular expression also supports email addresses with local parts that contain special characters, such as periods, plus signs, and quoted strings.

@SoftCreatR
SoftCreatR / helpers.css
Created January 29, 2018 23:18
CSS Helper Classes
View helpers.css
.no-p {
padding: 0px !important
}
.no-p-t {
padding-top: 0px !important
}
.no-p-r {
padding-right: 0px !important
@SoftCreatR
SoftCreatR / Dockerfile
Last active October 1, 2022 16:07
php-8.0.1-fpm-alpine3.12-imagick
View Dockerfile
ARG NAME_IMAGE_BASE='php'
ARG NAME_IMAGE_TAG='8.0.1-fpm-alpine3.12'
FROM ${NAME_IMAGE_BASE}:${NAME_IMAGE_TAG}
ARG ID_BUILD='build-20210118'
ARG VERSION_PHP='8.0.1-imagick'
ARG VERSION_OS='3.12.0'
ARG IMAGICK_COMMIT='448c1cd0d58ba2838b9b6dff71c9b7e70a401b90'
@SoftCreatR
SoftCreatR / fake-speedtest.php
Created September 18, 2021 11:29
Generate Fake Stats for speedtest.net
View fake-speedtest.php
<?php
$down = (!empty($_GET['down']) ? (int)$_GET['down'] : mt_rand(1000, 5000)) * 1000;
$up = (!empty($_GET['up']) ? (int)$_GET['down'] : mt_rand(1000, 5000)) * 1000;
$ping = !empty($_GET['ping']) ? (int)$_GET['ping'] : mt_rand(0, 20);
$server = !empty($_GET['server']) ? (int)$_GET['server'] : 6601; // https://c.speedtest.net/speedtest-servers-static.php
$accuracy = 8;
$headers = [
'POST /api/api.php HTTP/1.1',
View hello-world.js
[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[][(![]+[]
@SoftCreatR
SoftCreatR / settings.json
Last active July 11, 2022 00:23
Windows Terminal Stuff
View settings.json
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "copy",
"singleLine": false
@SoftCreatR
SoftCreatR / update-hcfw.sh
Last active April 17, 2022 20:21
Hetzner Cloud Firewall Cloudflare IP Updater using either curl, wget or httpie.
View update-hcfw.sh
#!/usr/bin/env bash
##############################################################
# Title : Hetzner Firewall Cloudflare IP Updater #
# Description : Allows you to update your Hetzner Cloud #
# Firewall to allow all incoming requests #
# from Cloudflare. #
# #
# Author : Sascha Greuel <hello@1-2.dev> #
# Date : 2021-03-30 09:30 #
@SoftCreatR
SoftCreatR / gist:303513be9b85f83a2819443fa7b422f3
Created April 15, 2022 21:23
Date Regex (dd.mm.yyyy) incl. leap years, etc.
View gist:303513be9b85f83a2819443fa7b422f3
^(?:(?:31\.(?:0?[13578]|1[02]))\.|(?:(?:29|30)\.(?:0?[13-9]|1[0-2])\.))(?:(?:1[6-9]|[2-9]\d)?\d{2})$|^(?:29\.0?2\.(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0?[1-9]|1\d|2[0-8])\.(?:(?:0?[1-9])|(?:1[0-2]))\.(?:(?:1[6-9]|[2-9]\d)?\d{2})$
View Deploy.yml
name: Main
on: [push]
jobs:
build:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- name: Setup Node.js
uses: actions/setup-node@v2.4.0