I hereby claim:
- I am rbayliss on github.
- I am rbayliss (https://keybase.io/rbayliss) on keybase.
- I have a public key ASBa65UfXH4FUKGkhTgE2hA4SPrpKB-5nO3yuUA5RYmaXAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
import { collect } from 'streaming-iterables'; | |
import { guard, mapGuard } from './guard'; | |
describe('mapGuard()', () => { | |
it('Should handle errors thrown while mapping.', async () => { | |
const err = new Error('An error'); | |
const mapper = (throwError: boolean) => { | |
if (throwError) { | |
throw err; | |
} |
<?php | |
$map = array( | |
'best_sandwiches' => 'field_sandwiches', | |
); | |
// Fatal error in PHP 7 | |
$sandwiches = $node->$map['best_sandwiches'] | |
// OK: | |
$sandwiches = $node->{$map['best_sandwiches']} |
@include foundation-global-styles; | |
@include foundation-typography; |
{# | |
This is a glue template. It maps Drupal data to a simpler structure. | |
In this case, it converts the items render array into an array | |
of rendered images, then passes that into the image-grid component. | |
It also handles outputting the wrapper with the attributes Drupal | |
requires. | |
#} | |
{% set images = [] %} | |
{% for item in items %} | |
{% set images = images|merge([item|render]) %} |
const puppeteer = require('puppeteer'); | |
const EventEmitter = require('events'); | |
/** | |
* Usage: | |
* | |
* const crawler = new Crawler('http://example.com'); | |
* | |
* crawler.on('insecureRequests', (e) => { | |
* console.log(`Caught insecure request on ${e.url} to ${e.requests}`); |
<?php | |
require_once __DIR__.'/vendor/autoload.php'; | |
$time = microtime(TRUE); | |
for($i = 0; $i < 1000; $i++) { | |
\League\Uri\Schemes\Http::createFromString('http://google.com'); | |
} |
/** | |
* Graceful degradation | |
*/ | |
#sidebar, #main { | |
float:left; | |
} | |
#sidebar { | |
width:25%; | |
} |
RewriteEngine On | |
# Determine the RewriteBase automatically and set it as environment variable. | |
# If you are using Apache aliases to do mass virtual hosting or installed the | |
# project in a subdirectory, the base path will be prepended to allow proper | |
# resolution of the app.php file and to redirect to the correct URI. It will | |
# work in environments without path prefix as well, providing a safe, one-size | |
# fits all solution. But as you do not need it in this case, you can comment | |
# the following 2 lines to eliminate the overhead. | |
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$ |
<?php | |
function cache_drush_command() { | |
$items = array(); | |
$items['cache-disable'] = array( | |
'description' => 'Disable caching.', | |
'arguments' => array( | |
'type' => 'Name of Caches to Disable' | |
), |