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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="[resize width only]"> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | |
<title>JS Bin</title> | |
</head> | |
<body> |
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
This has moved: | |
https://github.com/guardian/frontend/wiki/Browsers-on-theguardian.com |
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
#!/bin/bash -e | |
# Ensure we're running in location of script. | |
cd "`dirname $0`" | |
for f in *; do | |
if [[ $f == *@3x* ]]; | |
then | |
echo "$f -> ${f//@3x/@2x}, ${f//@3x/}" | |
convert "$f" -resize 66.66666% "${f//@3x/@2x}" |
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 | |
/** | |
* @file | |
* Defines a dropdown widget for integer fields. | |
*/ | |
namespace Drupal\nba_content_core\Plugin\Field\FieldWidget; | |
use Drupal\Core\Field\FieldFilteredMarkup; | |
use Drupal\Core\Field\FieldItemListInterface; |
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 HN_URL = 'https://hackernewsapi.example.com/'; | |
function updateUI(hnData) { | |
// Update the DOM. | |
} | |
async function init() { | |
const channel = new BroadcastChannel('hn-updates'); | |
channel.addEventListener('message', async (event) => { | |
if (event.data.payload.updatedUrl === HN_URL) { |
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
#!/usr/bin/env bash | |
# Allows you to test the create-project process using your local | |
# checked-out copy of the skeleton as the source. You MUST commit the | |
# changes you want to test to a git branch! You MUST name that branch | |
# as the first argument and the destination path to set up the fresh | |
# copy into as the second. | |
# | |
# Usage: | |
# - Place this script in your package's root directory and make it executable. | |
# - Set the PACKAGE_NAME variable below to match your composer.json's `name`. |
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 | |
/** | |
* Implements template_preprocess_field(). | |
*/ | |
function THEME_preprocess_field(&$vars) { | |
// If the view mode is "full" use <h2> for the field labels. Otherwise, | |
// assume a teaser or more compact view mode is being displayed, and use <h3>. | |
$vars['heading'] = ($vars['element']['#view_mode'] == 'full') ? 'h2' : 'h3'; |
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 | |
namespace Drupal\my_module\Plugin\Field\FieldFormatter; | |
use Drupal\Core\Field\FieldItemListInterface; | |
use Drupal\Core\Plugin\ContainerFactoryPluginInterface; | |
use Drupal\responsive_image\Plugin\Field\FieldFormatter\ResponsiveImageFormatter as ResponsiveImageFormatterCore; | |
/** | |
* Responsive image formatter that allow to force the format. |
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
# Default backend definition. Set this to point to your content server. | |
backend default { | |
.host = "127.0.0.1"; | |
.port = "8080"; | |
.connect_timeout = 60s; | |
.first_byte_timeout = 60s; | |
.between_bytes_timeout = 60s; | |
.max_connections = 800; | |
} |
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
/* | |
Read the https://storybook.js.org/docs/guides/guide-react/ | |
Configure: | |
1) open ./storybook/config.js | |
2) remove configure(require.context('../src', true, /\.stories\.js$/), module); | |
3) replace with the code below | |
4) change path prepare in to getTitle function | |
5) remove in story files export default.title |
OlderNewer