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
| Function preg_replace(text, strPattern As String, strReplace As String) | |
| Dim txt As String: txt = text | |
| Set regEx = CreateObject("VBScript.RegExp") | |
| With regEx | |
| .Global = True | |
| .MultiLine = False | |
| .IgnoreCase = False | |
| .Pattern = strPattern |
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
| function getDomain(url) { | |
| return url.match(/:\/\/(.[^/]+)/)[1]; | |
| } | |
| $("a[href^='http']").each(function() { | |
| $(this).css({ | |
| background: "url(http://www.google.com/s2/u/0/favicons?domain=" + getDomain(this.href) + | |
| ") left center no-repeat", | |
| "padding-left": "20px" | |
| }); |
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
| <filetype binary="false" description="Sphinx.conf" name="Sphinx config file" icon="AllIcons.Nodes.Static"> | |
| <highlighting> | |
| <options> | |
| <option name="LINE_COMMENT" value="#" /> | |
| <option name="COMMENT_START" value="" /> | |
| <option name="COMMENT_END" value="" /> | |
| <option name="HEX_PREFIX" value="" /> | |
| <option name="NUM_POSTFIXES" value="" /> | |
| <option name="HAS_BRACES" value="true" /> | |
| </options> |
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
| Adding and Removing Classes, with simple cross-browser JavaScript | |
| The standard JavaScript way to select an element is using document.getElementById("Id"), which is what the following examples use - you can of course obtain elements in other ways, and in the right situation may simply use this instead - however, going into detail on this is beyond the scope of the answer. | |
| To change all classes for an element: | |
| To replace all existing classes with one or more new classes, set the className attribute: | |
| document.getElementById("MyElement").className = "MyClass"; | |
| (You can use a space-delimited list to apply multiple classes.) |
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 Bolt\Provider; | |
| use Cocur\Slugify\Slugify; | |
| use Silex\Application; | |
| use Silex\ServiceProviderInterface; | |
| class SanitizerProvider implements ServiceProviderInterface | |
| { | |
| protected $replacement; |
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 | |
| $app['upload'] = $app->share( | |
| $app->extend( | |
| 'upload', | |
| function (\Sirius\Upload\Handler $uploadHandler) { | |
| $uploadHandler->setSanitizerCallback( | |
| function ($filename) { | |
| $clean_name = $filename; | |
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 MyNewApp\Command; | |
| use Symfony\Component\Console\Command\Command; | |
| use Symfony\Component\Console\Input\InputInterface; | |
| use Symfony\Component\Console\Output\OutputInterface; | |
| use Symfony\Component\Console\Input\InputOption; | |
| use Bolt\Application; |
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 Mysite\Command; | |
| use Symfony\Component\Console\Command\Command; | |
| use Symfony\Component\Console\Input\InputInterface; | |
| use Symfony\Component\Console\Output\OutputInterface; | |
| use Symfony\Component\Console\Input\InputOption; | |
| use Bolt\Application; |
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 MyApp\Response; | |
| use Symfony\Component\HttpFoundation\Response; | |
| class CsvResponse extends Response | |
| { | |
| protected $data; |
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
| $app['upload'] = $app->share( | |
| $app->extend( | |
| 'upload', | |
| function ($uploadHandler) { | |
| $uploadHandler->setSanitizerCallback( | |
| function ($filename) { | |
| // Do things with filename string here. | |
| return $filename; | |
| } | |
| ); |