This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
/** | |
* @file | |
* Based on http://www.magentocommerce.com/boards/viewthread/113901/P30/#t277875 | |
* | |
* @todo | |
* - fix importing | |
* - fix logging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
php -n \ | |
-d "extension=mbstring.so" \ | |
-d "extension=pdo.so" \ | |
-d "extension=pdo_sqlite.so" \ | |
-d "extension=json.so" \ | |
-d "extension=phar.so" \ | |
-d "extension=tokenizer.so" \ | |
-d "extension=xml.so" \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This is an alternative way of handling warnings from calling count() on | |
* non-countables. It's just an error handler that drops the warning, and calls | |
* the previous error handler for everything else (if there is one). | |
*/ | |
$previous = set_error_handler(function ($errno, $errstr, $errfile, $errline, $errcontext) use (&$previous) { | |
// Do nothing with an E_WARNING from count. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
foreach (Imagick::queryFonts() as $fontName) { | |
$image = new Imagick; | |
$draw = new ImagickDraw; | |
$draw->setGravity(Imagick::GRAVITY_CENTER); | |
$draw->setFont($fontName); | |
$draw->setFontSize(12); | |
$draw->setFillColor('black'); | |
$image->newImage(300, 20, 'lightblue'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It's time for user agents to stop requesting this file. | |
- https://www.w3.org/2005/10/howto-favicon | |
- https://blog.whatwg.org/the-road-to-html-5-link-relations#rel-icon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @param string $row | |
* @return array | |
* An assoc with the following properties: | |
* - name | |
* - type: one of directory, file, link, unknown | |
* - size | |
* - owner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This is for everyone who hates the indenting behavior of switch/case. | |
* | |
* If using PSR-2 and you're getting this error: | |
* PSR2.ControlStructures.SwitchDeclaration.WrongOpenercase | |
* @see https://github.com/squizlabs/PHP_CodeSniffer/issues/3016 | |
*/ | |
$var = 'foo'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @param string $regex | |
* @return bool | |
*/ | |
function isValidRegularExpression($regex) { | |
set_error_handler(function() {}, E_WARNING); | |
$valid = preg_match($regex, null) !== FALSE; | |
restore_error_handler(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class AppServiceProvider | |
{ | |
public function boot() | |
{ | |
// The closure will only be called if the attribute is in the request. | |
Validator::extend('forbidden', function ($attribute, $value, $parameters) { | |
// Always return false. | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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= |
OlderNewer