This file contains 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 dump_to_file(...$any) { | |
ob_start(); | |
var_dump(...$any); | |
file_put_contents('log.txt', ob_get_clean(), FILE_APPEND); | |
} |
This file contains 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
describe('Some interaction', () => { | |
// … do something | |
await writeDocs({ | |
info: { | |
title: 'Title of the "step"', | |
}, | |
screenshots: [ | |
// takes a screenshot of the first (0) browser page | |
{ |
This file contains 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
const renderScreenshot = ({ | |
title = '', | |
slug = '', | |
pageIndex = 0, | |
screenshotPath = '', | |
description = '', | |
}) => `<figure id="${slug}-${pageIndex}"> | |
<img src="${screenshotPath}" title="${title}" /> | |
<figcaption>${description}</figcaption> | |
</figure>`; |
This file contains 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
// NOTE: this code is not intended to work as-is, | |
// it needs to be adapted to your setup/environment | |
const NodeEnvironment = require('jest-environment-node'); | |
const puppeteer = require('puppeteer'); | |
const path = require('path'); | |
const rimraf = require('rimraf'); | |
const mkdirp = require('mkdirp'); | |
const httpServer = require('http-server'); | |
// very useful tool to turn a callback function into a async function ;) |
This file contains 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
const renderScreenshot = ({ | |
title = '', | |
slug = '', | |
pageIndex = 0, | |
screenshotPath = '', | |
description = '', | |
}) => `<figure id="${slug}-${pageIndex}"> | |
<img src="${screenshotPath}" title="${title}" /> | |
<figcaption>${description}</figcaption> | |
</figure>`; |
This file contains 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
const renderScreenshot = ({ | |
title = '', | |
slug = '', | |
pageIndex = 0, | |
screenshotPath = '', | |
description = '', | |
}) => `<figure id="${slug}-${pageIndex}"> | |
<img src="${screenshotPath}" title="${title}" /> | |
<figcaption>${description}</figcaption> | |
</figure>`; |
This file contains 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
// can be runned from the Devel execute PHP page | |
use Drupal\image\Entity\ImageStyle; | |
$path = 'public://2018-03/26756519_10155441271337695_6783993404862700965_o.jpg'; | |
$thumbnail = ImageStyle::load('article'); | |
dpm($thumbnail->buildUrl($path)); | |
$dest = $thumbnail->buildUri($path); | |
dpm($dest); | |
$created = $thumbnail->createDerivative($path, $dest); |
This file contains 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
signals: | |
colorA: | |
type: hsla | |
defaultValue: '180,50%,50%,1' | |
input: null | |
hue: 180 | |
saturation: 50 | |
lightness: 50 | |
alpha: 100 | |
beatA: |
This file contains 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
signals: | |
colorA: | |
type: hsla | |
defaultValue: '180,50%,50%,1' | |
input: null | |
hue: 180 | |
saturation: 50 | |
lightness: 50 | |
alpha: 100 | |
beatA: |
This file contains 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
signals: | |
colorA: | |
type: hsla | |
defaultValue: 1 | |
input: null | |
hue: 180 | |
saturation: 50 | |
lightness: 50 | |
alpha: 100 | |
beatA: |
NewerOlder