Skip to content

Instantly share code, notes, and snippets.

View JBlond's full-sized avatar

Mario JBlond

  • Germany
  • 07:42 (UTC +02:00)
View GitHub Profile
@JBlond
JBlond / uncide.php
Created July 31, 2020 11:41
PHP unicode
<?php
class 🤘 {
const 😁 = '👽';
public function 🤡()
{
return self::😁;
}
}
@JBlond
JBlond / leapyear.php
Created July 22, 2020 11:31
leap year
<?php
function isLeapYear(int $year): bool
{
return $year % 4 == 0 && $year % 100 != 0 || $year % 400 == 0;
}
@JBlond
JBlond / openssl_configure.md
Last active June 26, 2020 10:16
OpenSSL configure options

OpenSSL Configure Options (1.1.1g)

Standard party line

Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimental-<cipher> ...]
                 [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw]
                 [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm]
                 [no-dso] [no-krb5] [sctp] [386] [--prefix=DIR]
                 [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity]
@JBlond
JBlond / rebootlist.sh
Last active April 10, 2023 12:34
reboot
#!/bin/bash
who -b
last reboot | less
last reboot | head -1
last -x|grep shutdown | head -1
@JBlond
JBlond / tailf-with-colors.sh
Last active December 20, 2023 19:40
Tail logs with color for Monolog
tailf-with-colors () {
if [ -z "$1" ] ; then
echo "Please specify a file for monitoring"
return
fi
tail -f $1 | awk '
{matched=0}
/INFO:/ {matched=1; print "\033[0;37m" $0 "\033[0m"} # WHITE
/DEBUG:/ {matched=1; print "\033[0;37m" $0 "\033[0m"} # WHITE
@JBlond
JBlond / idea-monolog-pattern.md
Last active January 7, 2025 12:04
PHP Storm IDE monlog pattern
Message pattern: `^\[(.*)\] (.+?)\.([A-Z]+): (.*)`
Message start pattern: `^\[`
Time format: `yyyy-MM-dd HH:mm:ss`
Time capture group: `1`
Severity capture group: `3`
Category capture group: `2`
@JBlond
JBlond / 00-default.conf
Last active January 7, 2025 12:04
Apache example
<VirtualHost _default_:80>
DocumentRoot "C:/default"
<Directory "C:/default">
Options Indexes FollowSymLinks
AllowOverride All
Require local
</Directory>
CustomLog "C:\nul" common
@JBlond
JBlond / svn_create_package.cmd
Created May 21, 2019 14:31
create svn package
@echo off
mkdir __PACKAGE__
cd __PACKAGE__
set SVN_PACKAGE_PATH=%cd%
mkdir bin
mkdir doc
mkdir modules
mkdir tools
cd ..
xcopy /E tools %SVN_PACKAGE_PATH%\tools\
@JBlond
JBlond / uniocode_random.sh
Created April 5, 2019 13:24
Unide code ramdom in bash
#!/bin/bash
while true; do
rand=$(shuf -i 2600-2700 -n 1)
echo -n -e ' \u'$rand
sleep 1
done
@JBlond
JBlond / .editorconfig
Created February 25, 2019 14:38
.editorconfig
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true