This file contains hidden or 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 | |
| namespace MyBundle\Handler\FingersCrossed; | |
| use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy as BaseErrorLevelActivationStrategy; | |
| use Symfony\Component\HttpKernel\Exception\HttpException; | |
| /** | |
| * Activation strategy that ignores client errors (4xx) | |
| */ | |
| class ErrorLevelActivationStrategy extends BaseErrorLevelActivationStrategy |
This file contains hidden or 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
| var LibName = (function () { | |
| function LibName() { | |
| // ... | |
| } | |
| if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { | |
| // AMD. Register as an anonymous module. | |
| define(function() { | |
| 'use strict'; |
This file contains hidden or 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 | |
| namespace Component\AdyenCreditCard; | |
| use Component\AdyenCreditCard\DataService\ResponseLogDataService; | |
| use GuzzleHttp\Client; | |
| use GuzzleHttp\Exception\RequestException; | |
| class PaymentHandler | |
| { | |
| /** |
This file contains hidden or 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
| <!-- | |
| sudo vim /Library/LaunchDaemons/local.httpdfwd.plist | |
| sudo launchctl load -Fw /Library/LaunchDaemons/local.httpdfwd.plist | |
| https://echo.co/blog/os-x-1010-yosemite-local-development-environment-apache-php-and-mysql-homebrew | |
| --> | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"\> | |
| <plist version="1.0"> |
This file contains hidden or 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
| # SSH tunnel, so it's possible to connect to remote server services via SSH | |
| # argument: local_port, dest_port, host | |
| ssh_tunnel () { | |
| lsof -i:$1 > /dev/null 2>&1 || ssh -fNg -L $1:127.0.0.1:$2 $3 | |
| } | |
| # sample: mysql | |
| ssh_tunnel 3307 3306 HOST |
This file contains hidden or 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
| # | |
| # install https://github.com/tagomoris/fluent-plugin-forest | |
| # | |
| # test | |
| <source> | |
| type tail | |
| format /^(?<log>.*)$/ | |
| tag test | |
| path /tmp/test.log |
This file contains hidden or 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
| location / { | |
| try_files $uri /app.php$is_args$args; | |
| } | |
| location ~ ^.+\.php(/|$) { | |
| fastcgi_pass 127.0.0.1:9000; | |
| fastcgi_split_path_info ^(.+\.php)(/.*)$; | |
| include fastcgi_params; | |
| fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; | |
| fastcgi_param DOCUMENT_ROOT $realpath_root; |
This file contains hidden or 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 | |
| $file = $argv[1]; | |
| $table = $argv[2]; | |
| $ls = file($file); | |
| $out = ""; | |
| foreach ($ls as $l) { | |
| $d = str_getcsv(trim($l)); |
This file contains hidden or 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
| -- convert from base-16 to base-36 (128bit precision) | |
| CREATE FUNCTION conv(_hex TEXT) | |
| RETURNS TEXT | |
| BEGIN | |
| DECLARE _hex_len TINYINT; | |
| DECLARE _dec DECIMAL(65); | |
| DECLARE _chars CHAR(36); | |
| DECLARE _base36 TEXT; | |
| DECLARE _mod TINYINT; |
This file contains hidden or 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
| <VirtualHost *> | |
| ServerName auth.dev | |
| DocumentRoot "/var/www/auth" | |
| ProxyPassMatch ^(/.*\.php)$ fcgi://127.0.0.1:9000/var/www/auth | |
| SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 | |
| </VirtualHost> |