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
// For a JS object like so | |
const sassMapObj = { | |
namespace: { | |
primary: { | |
white: '#fff', | |
}, | |
secondary: { | |
black: '#000', | |
}, | |
}, |
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
<!-- wp:cover {"url":"/sites/default/files/inline-images/bKwo5axttdsDP9G6qsVTwBF3mAEMCsxvn3Kh6DHZkrlCFK6IQc.jpg","id":1,"focalPoint":{"x":"0.41","y":"0.48"},"align":"wide","mediaAttrs":{"data-entity-type":"file","data-entity-uuid":"41e16525-3af8-404b-8db8-08afff83a1e7","data-image-style":"original"}} --><div class="wp-block-cover alignwide has-background-dim" style="background-image:url(/sites/default/files/inline-images/bKwo5axttdsDP9G6qsVTwBF3mAEMCsxvn3Kh6DHZkrlCFK6IQc.jpg);background-position:41% 48%" data-entity-type="file" data-entity-uuid="41e16525-3af8-404b-8db8-08afff83a1e7" data-image-style="original"><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"left","placeholder":"Write title…","fontSize":"large"} --><p class="has-text-align-left has-large-font-size">This is a title</p><!-- /wp:paragraph --></div></div><!-- /wp:cover --><!-- wp:heading {"align":"center"} --><h2 class="has-text-align-center">Test title</h2><!-- /wp:heading --><!-- wp:phase2/p2-massive-cover {"title":"Titl |
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
// src/_patterns/02-molecules/carousel/index.js | |
import carouselPlugin from 'some/bloated/carousel/plugin/project'; | |
export function enable($context, settings) { | |
// ... | |
carouselPlugin.goBackText = settings.carousel.strings.goBackText || 'Go back'; | |
carouselPlugin.goForwardText = settings.carousel.strings.goForwardText || 'Go back'; | |
}; |
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
// apps/drupal/index.js | |
import { carousel } from '../../source/design-system'; | |
Drupal.behaviors.carouselIntegration = { | |
attach($context) { | |
carousel.enable($context, { | |
strings: { | |
goBackText: Drupal.t('Go back'), | |
goForwardText: Drupal.t('Go forward'), |
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 | |
# 1. Skip steps if you already have the tools listed | |
# 2. Run source ~/.bashrc or source ~/.zshrc after each step to ensure command is registered | |
# Install Homebrew, if not installed | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# Update Homebrew installed packages | |
brew update && brew upgrade |
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 path = require('path'); | |
const through = require('through2'); | |
const sassExtract = require('sass-extract'); | |
const _ = require('lodash'); | |
/** | |
* Parse a sass file, discover all Sass vars, write to json | |
* See https://github.com/contra/gulp-concat/blob/master/index.js for inspiration | |
* @param fileName | |
* @param opt |
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
<html> | |
<body> | |
<div id="app"> | |
<div> | |
{{ notes }} | |
</div> | |
<button @click='increase'>Increase</button> | |
<button @click='decrease'>Decrease</button> | |
</div> |
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
import { slick } from 'slick'; | |
import { jQuery as $ } from 'jquery'; | |
export default function(context) { | |
// jquery plugins not this easy in reality, tbd | |
$('.carousel-thingy', context).slick(); | |
} |
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
function placeCards(cardCollection, $cardRegion, $interp) { | |
cardCollection.forEach(function(element, index, array) { | |
var $img = $('<img>').attr('src', element.image); | |
var $text = $('<p>' + element.reading + '</p>'); | |
$cardRegion.append($img); | |
$interp.append($text); | |
}); | |
} |
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
function shuffle(shufflearray) { | |
var i = shufflearray.length; | |
var j; | |
var temp; | |
while(i-- > 0) { | |
j = Math.floor(Math.random() * (i + 1)); | |
temp = shufflearray[j]; | |
shufflearray[j] = shufflearray[i]; | |
shufflearray[i] = temp; |
NewerOlder