Since Mavericks stopped using the deprecated ipfw (as of Mountain Lion), we'll be using pf to allow port forwarding.
####1. anchor file
Create an anchor file under /etc/pf.anchors/<anchor file> with your redirection rule like:
| (function ($) { | |
| Drupal.fooModule = Drupal.fooModule || {}; | |
| Drupal.fooModule.success = function (response, status) { | |
| // do some cusotm coding if needed. | |
| // Call original method with main functionality. | |
| Drupal.ajax.prototype.success.call(this, response, status); | |
| }; | |
| Drupal.behaviors.fooModule = { |
| <?php | |
| require_once 'vendor/autoload.php'; // or however you load Twig | |
| require_once 'Lexer.php'; | |
| require_once 'Indent.php'; | |
| $twig = new Twig_Environment(new Twig_Loader_Filesystem('templates')); | |
| $twig->addExtension(new Indent_Twig_Extension()); | |
| $twig->setLexer(new Indent_Twig_Lexer($twig)); |
| // x, y, width, height | |
| // x & y position from top left corner of document | |
| // width & height of selection | |
| // | |
| // makeSelection(10,50,200,100); | |
| function makeSelection(x,y,sw,sh){ | |
| app.activeDocument.selection.select([ [x,y], [x,y+sh], [x+sw,y+sh], [x+sw,y] ]); | |
| } |
| Given /^(?:|I )am on "(?P<page>[^"]+)"$/ | |
| Given /^(?:|I )am on (?:|the )homepage$/ | |
| Given :type content: | |
| Given :vocabulary terms: | |
| Given I am an anonymous user | |
| Given I am at :path | |
| Given I am logged in as :name | |
| Given I am logged in as a user with the :permissions permission(s) | |
| Given I am logged in as a user with the :role role(s) | |
| Given I am logged in as a user with the :role role(s) and I have the following fields: |
| /** | |
| * This function assumes you have a Customizer export file in your theme directory | |
| * at 'data/customizer.dat'. That file must be created using the Customizer Export/Import | |
| * plugin found here... https://wordpress.org/plugins/customizer-export-import/ | |
| */ | |
| function import_customizer_settings() | |
| { | |
| // Check to see if the settings have already been imported. | |
| $template = get_template(); | |
| $imported = get_option( $template . '_customizer_import', false ); |
| input.form-submit.button-small { | |
| padding: 4px 8px; | |
| font-weight: bold; | |
| } | |
| .container-inline input.form-submit.button-small + .ajax-progress.ajax-progress-throbber .throbber { | |
| position: absolute; | |
| left: 19px; | |
| margin-top: 7px; | |
| } |
| npm install --save react react-dom && npm install --save-dev html-webpack-plugin webpack webpack-dev-server babel-{core,loader} babel-preset-{react,es2015,stage-0} style-loader css-loader |
| // ES6 Fetch docs | |
| // https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch | |
| fetch('https://some.url.com') | |
| .then(response => { | |
| if (response.ok) { | |
| return Promise.resolve(response); | |
| } | |
| else { | |
| return Promise.reject(new Error('Failed to load')); |
| <?php | |
| // Import arbitrary config from a variable. | |
| // Assumes $data has the data you want to import for this config. | |
| $config = \Drupal::service('config.factory')->getEditable('filter.format.basic_html'); | |
| $config->setData($data)->save(); | |
| // Or, re-import the default config for a module or profile, etc. | |
| \Drupal::service('config.installer')->installDefaultConfig('module', 'my_custom_module'); |