Skip to content

Instantly share code, notes, and snippets.

View ameenross's full-sized avatar

Ameen Ross ameenross

View GitHub Profile
@ameenross
ameenross / check_regex.php
Last active April 29, 2021 10:34 — forked from smichaelsen/check_regex.php
PHP: Check if string is valid regular expression
<?php
/**
* @param string $regex
* @return bool
*/
function isValidRegularExpression($regex) {
set_error_handler(function() {}, E_WARNING);
$valid = preg_match($regex, null) !== FALSE;
restore_error_handler();
@ameenross
ameenross / .config_autostart_lockScreen.sh.desktop
Last active June 3, 2022 13:29
Log Gnome login/logout and lock screen events
[Desktop Entry]
Type=Application
Exec=./lockScreen.sh lock_screen.log
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en]=Log lock screen events
Name=Log lock screen events
Comment[en]=
Comment=