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
| worker_processes 1; | |
| events { | |
| worker_connections 1024; | |
| } | |
| http { | |
| include /home/t/nginx/conf/mime.types; | |
| default_type application/octet-stream; |
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 | |
| $regex = '/@((([^.]+)\.)+)([a-zA-Z]{3,}|[a-zA-Z.]{5,})/'; | |
| preg_match($regex, 'test@gmail.com', $matches); | |
| print_r($matches); | |
| preg_match($regex, 'test@google.co.uk', $matches); | |
| print_r($matches); |
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 | |
| /** | |
| * Convert your keyword tv to Sterc's SeoPro | |
| * | |
| * Please read the following. | |
| * Everytime you run this snippet, your keywords within seoPro will be overwritten. | |
| * Make sure the TV exists before runnig this code. | |
| * | |
| */ | |
| $seoPro = $modx->getService('seopro', 'seoPro', $modx->getOption('seopro.core_path', null, $modx->getOption('core_path') . 'components/seopro/') . 'model/seopro/', $scriptProperties); |
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
| @mixin breakpoint($point) | |
| @if $point == lg | |
| @media (min-width: 1200px) | |
| @content | |
| @else if $point == md | |
| @media (min-width: 992px) and (max-width: 1199px) | |
| @content | |
| @else if $point == sm |
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 | |
| /* | |
| HHVMinfo - phpinfo page for HHVM HipHop Virtual Machine | |
| Author: _ck_ | |
| License: WTFPL, free for any kind of use or modification, I am not responsible for anything, please share your improvements | |
| Version: 0.0.6 | |
| * revision history | |
| 0.0.6 2014-08-02 display fix for empty vs zero | |
| 0.0.5 2014-07-31 try to determine config file from process command line (may not always work), style improvements |
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
| import ConfigParser, mmap | |
| config_file = "/usr/share/applications/google-chrome.desktop" | |
| add_string_to_each_section = ["StartupWMClass", "Google-chrome-stable"] | |
| option = add_string_to_each_section[0] | |
| value = add_string_to_each_section[1] | |
| class Fixer: | |
| def check(self, cf, option, value): |
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 | |
| /* | |
| getTVLabel snippet for modx 2.3 | |
| Version: | |
| ------------------ | |
| v0.0.1 (2015-03-06 16:44) | |
| Author: | |
| ------------------ |
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 | |
| $eventName = $modx->event->name; | |
| switch($eventName) { | |
| case 'OnDocFormPrerender': | |
| if (!is_object($resource)) { // prevents bad error when user doesn't have perms to resource | |
| $modx->log(modX::LOG_LEVEL_ERROR, '[ContentBlocks Templates] No Resource Object on line: ' . __LINE__); | |
| return; | |
| } | |
| // a system setting must be created with the key 'contentblocks.enabled_template_ids' | |
| $enabledTemplates = array_map('trim', explode(',', $modx->getOption('contentblocks.enabled_template_ids'))); |
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 | |
| /* | |
| * This file is part of the MODSlim package. | |
| * | |
| * Copyright (c) Jason Coward <jason@opengeek.com> | |
| * | |
| * For the full copyright and license information, please view the LICENSE | |
| * file that was distributed with this source code. | |
| */ |
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 | |
| // Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored) | |
| // http://youtu.be/dQw4w9WgXcQ | |
| // http://www.youtube.com/embed/dQw4w9WgXcQ | |
| // http://www.youtube.com/watch?v=dQw4w9WgXcQ | |
| // http://www.youtube.com/?v=dQw4w9WgXcQ | |
| // http://www.youtube.com/v/dQw4w9WgXcQ | |
| // http://www.youtube.com/e/dQw4w9WgXcQ | |
| // http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ |