Skip to content

Instantly share code, notes, and snippets.

View mejta's full-sized avatar
:electron:
Crafting websites and web applications

Daniel Mejta mejta

:electron:
Crafting websites and web applications
View GitHub Profile
@mejta
mejta / clean-wordpress-uploads.php
Last active April 7, 2022 23:42
Script that cleans unused files in WordPress uploads folder
<?php
/**
* Find WordPress wp-blog-header.php file.
*
* @param string $folder
*
* @return string
*/
function find_blog_header( string $folder ): string {
module.exports = {
extends: ['airbnb', 'plugin:jest/recommended'],
parser: 'typescript-eslint-parser',
plugins: ['typescript', 'babel', 'jest', 'react-hooks'],
env: {
'browser': true,
'node': true,
'jest/globals': true,
},
parserOptions: {
#!/usr/bin/env bash
PATH_SSL="$PWD/ssl"
# Path to the custom actijoy $(hostname) Root CA certificate.
PATH_ROOT_CNF="${PATH_SSL}/ca.actijoy.$(hostname).cnf"
PATH_ROOT_CRT="${PATH_SSL}/ca.actijoy.$(hostname).crt"
PATH_ROOT_KEY="${PATH_SSL}/ca.actijoy.$(hostname).key"
# Path to the custom site certificate.
@mejta
mejta / html-helper.php
Last active November 15, 2019 13:57
PHP helper functions for creating HTML tags
<?php
namespace HtmlHelpers;
function el(string $tag, array $atts = [], array $content = []) {
if (empty($content)) {
return '<' . join(' ', array_filter([$tag, at($atts)])) . ' />';
}
return '<' . join(' ', array_filter([$tag, at($atts)])) . '>' . join($content) . '</' . $tag . '>';
}

Keybase proof

I hereby claim:

  • I am mejta on github.
  • I am mejta (https://keybase.io/mejta) on keybase.
  • I have a public key ASD7KOA6mXOBJYiCOaJXbnG7cXEHKX5xHjoKMR2ICEtQFAo

To claim this, I am signing this object:

RewriteCond %{HTTPS} !on
RewriteCond %{HTTP_HOST} p-lab\.cz$
RewriteRule .? https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP_HOST} ^p-lab\.cz$
RewriteRule .? https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
#!/bin/sh
if [[ $EUID == 0 ]]; then
echo "Refusing to run as sudo" 2>&1
exit 1
fi
# check if library exists
# lib exists if there is installed version in brew
checkLib() {