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
| vendor # ignore composer data | |
| # ignore PHP Storm config | |
| # you may want to ignore your IDE config and you may want to commit it, up to you | |
| .idea |
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 | |
| function buildUrl($uri, array $params) { | |
| $matches = []; | |
| $pattern = '{\s* ([a-zA-Z_][a-zA-Z0-9_-]*) \s*(?:: \s* ([^{}]*(?:\{(?-1)\}[^{}]*)*))?\}'; | |
| $optionalSegments = '\[.*'.$pattern.'\]'; | |
| $uri = preg_replace_callback('~'.$optionalSegments.'~x', function($match) use ($params) { | |
| $uri = trim($match[0], '[]'); | |
| if (isset($params[$match[1]])) { |
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
| // ==UserScript== | |
| // @name Tweet icon for Jeeves in SO chat | |
| // @namespace http://room11.org/ | |
| // @version 1.0 | |
| // @description @PeeHaa sucks | |
| // @author @DaveRandom | |
| // @match *://chat.stackoverflow.com/rooms/* | |
| // @grant none | |
| // ==/UserScript== |
OlderNewer