Skip to content

Instantly share code, notes, and snippets.

View jasloe's full-sized avatar
💭
I may be slow to respond.

Jason Loeffler jasloe

💭
I may be slow to respond.
View GitHub Profile
@jasloe
jasloe / hoc.jsx
Created December 27, 2023 21:30
Example HOC
import React from 'react';
import Layout from '../components/Layout/Layout';
const withLayout = (PageComponent) => {
const WithLayout = (props) => (
<Layout {...props}>
<PageComponent {...props} />
</Layout>
);
@jasloe
jasloe / reset.css
Created November 22, 2023 03:00 — forked from Asjas/reset.css
Modern CSS Reset - Andy Bell
// https://piccalil.li/blog/a-modern-css-reset
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Remove default margin */
{
"extends": ["wesbos"],
"rules": {
"root": true,
"no-console": 2,
"prettier/prettier": [
"error",
{
"trailingComma": "es5",
"singleQuote": true,
use Drupal\node\NodeInterface;
use Drupal\Core\Template\Attribute;
use Drupal\Core\Url;
/**
* Implements hook_preprocess_page() for page.html.twig.
*/
function THEME_preprocess_page(&$vars) {
// Add sitename and slogan to page.
$vars['site_name'] = \Drupal::config('system.site')->get('name');
@jasloe
jasloe / dates.twig
Last active December 9, 2021 23:23
Put this into a preprocess function
{#
/**
* @file
* Theme override to display a node.
*
* Available variables:
* - node: The node entity with limited access to object properties and methods.
* Only method names starting with "get", "has", or "is" and a few common
* methods such as "id", "label", and "bundle" are available. For example:
* - node.getCreatedTime() will return the node creation timestamp.
@jasloe
jasloe / node-paragraph-migration.md
Last active August 5, 2021 19:19
node-paragraph-migration.md

data source

{
    "field_article_page_section": [
        {
            "target_id": 814,
            "target_revision_id": 814,
            "target_type": "paragraph",
            "target_uuid": "e1a8229f-0c7e-43dc-8942-d8e8915478d0"
a:6:{s:5:"%type";s:5:"Error";s:8:"@message";s:44:"Call to a member function toString() on null";s:9:"%function";s:64:"Drupal\html_title\Plugin\views\field\NodeHtmlTitle->renderText()";s:5:"%file";s:87:"/var/www/drupal/web/modules/contrib/html_title/src/Plugin/views/field/NodeHtmlTitle.php";s:5:"%line";i:28;s:17:"@backtrace_string";s:7068:"#0 /var/www/drupal/web/core/modules/views/src/Plugin/views/field/FieldPluginBase.php(1203): Drupal\html_title\Plugin\views\field\NodeHtmlTitle->renderText(Array)
#1 /var/www/drupal/web/core/modules/views/views.theme.inc(238): Drupal\views\Plugin\views\field\FieldPluginBase->advancedRender(Object(Drupal\views\ResultRow))
#2 /var/www/drupal/web/core/lib/Drupal/Core/Theme/ThemeManager.php(287): template_preprocess_views_view_field(Array, 'views_view_fiel...', Array)
#3 /var/www/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(431): Drupal\Core\Theme\ThemeManager->render('views_view_fiel...', Array)
#4 /var/www/drupal/web/core/lib/Drupal/Core/Render/Renderer.php(200): Drupal\
a:6:{s:5:"%type";s:6:"Notice";s:8:"@message";O:25:"Drupal\Core\Render\Markup":1:{s:9:"*string";s:51:"Trying to access array offset on value of type null";}s:9:"%function";s:64:"Drupal\html_title\Plugin\views\field\NodeHtmlTitle->renderText()";s:5:"%file";s:87:"/var/www/drupal/web/modules/contrib/html_title/src/Plugin/views/field/NodeHtmlTitle.php";s:5:"%line";i:28;s:17:"@backtrace_string";s:7381:"#0 /var/www/drupal/web/core/includes/bootstrap.inc(305): _drupal_error_handler_real(8, 'Trying to acces...', '/var/www/drupal...', 28)
#1 /var/www/drupal/web/modules/contrib/html_title/src/Plugin/views/field/NodeHtmlTitle.php(28): _drupal_error_handler(8, 'Trying to acces...', '/var/www/drupal...', 28, Array)
#2 /var/www/drupal/web/core/modules/views/src/Plugin/views/field/FieldPluginBase.php(1203): Drupal\html_title\Plugin\views\field\NodeHtmlTitle->renderText(Array)
#3 /var/www/drupal/web/core/modules/views/views.theme.inc(238): Drupal\views\Plugin\views\field\FieldPluginBase->advancedRender(Object(Drupal\views\R
a:6:{s:5:"%type";s:6:"Notice";s:8:"@message";O:25:"Drupal\Core\Render\Markup":1:{s:9:"*string";s:25:"Undefined index: rendered";}s:9:"%function";s:64:"Drupal\html_title\Plugin\views\field\NodeHtmlTitle->renderText()";s:5:"%file";s:87:"/var/www/drupal/web/modules/contrib/html_title/src/Plugin/views/field/NodeHtmlTitle.php";s:5:"%line";i:28;s:17:"@backtrace_string";s:7381:"#0 /var/www/drupal/web/core/includes/bootstrap.inc(305): _drupal_error_handler_real(8, 'Undefined index...', '/var/www/drupal...', 28)
#1 /var/www/drupal/web/modules/contrib/html_title/src/Plugin/views/field/NodeHtmlTitle.php(28): _drupal_error_handler(8, 'Undefined index...', '/var/www/drupal...', 28, Array)
#2 /var/www/drupal/web/core/modules/views/src/Plugin/views/field/FieldPluginBase.php(1203): Drupal\html_title\Plugin\views\field\NodeHtmlTitle->renderText(Array)
#3 /var/www/drupal/web/core/modules/views/views.theme.inc(238): Drupal\views\Plugin\views\field\FieldPluginBase->advancedRender(Object(Drupal\views\ResultRow))
#4 /var/www/drupa
@jasloe
jasloe / fixed.html
Last active October 28, 2020 15:29
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<title>Type specimen</title>
<!--[if !mso]><!-- -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!--<![endif]-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">