Skip to content

Instantly share code, notes, and snippets.

@davidpmccormick
davidpmccormick / prismic-summary.js
Created October 25, 2023 10:30
Wraps the items from a Prismic repeating group field in a details/summary for easier re-ordering
let widgetGroups = document.querySelectorAll('.widget-Group');
[...widgetGroups].forEach(widgetGroup => {
let groupWrapper = widgetGroup.querySelector('.group-wrapper');
let standaloneTitle = groupWrapper.querySelector('[data-widget-key="standaloneTitle"] .ProseMirror').textContent;
let title = groupWrapper.querySelector('[data-widget-key="title"] .ProseMirror').textContent;
let tools = widgetGroup.querySelector('.tools');
tools.style.top = "0";
let detailsNode = document.createElement('details');
.container--scroll {
&.container--scroll-s {
@include respond-between('small', 'medium') {
max-width: none;
width: auto;
overflow: auto;
padding: 0;
}
}
function unwrapChildren(node, tag) {
const treeAdapter = parse.treeAdapters.default;
const nodeTagName = treeAdapter.getTagName(node);
const newEl = treeAdapter.createElement(nodeTagName);
const childNodes = treeAdapter.getChildNodes(node);
childNodes.forEach((childNode) => {
if (childNode.nodeName !== tag) {
treeAdapter.appendChild(newEl, childNode);
} else {
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
{
"bold_folder_labels": false,
"caret_style": "phase",
"color_scheme": "Packages/User/DMC (SL).tmTheme",
"detect_indentation": true,
"detect_slow_plugins": false,
"dictionary": "Packages/Language - English/en_GB.dic",
"file_exclude_patterns":
[
".DS_Store",
@davidpmccormick
davidpmccormick / project_images
Created September 28, 2012 16:06
Project images -- how best to check if any of them are portrait aspect
<project>
<section id="3" handle="projects">Projects</section>
<entry id="51">
<title handle="nokia-people">Nokia People</title>
<images field-id="4" subsection-id="1" items="23">
<item id="43">
<image size="1.03 MB" path="/assets/images" type="image/jpeg">
<filename>page-1-mike-1348214361.jpg</filename>
<meta creation="2012-09-21T08:59:21+01:00" width="885" height="1328" />
</image>
@davidpmccormick
davidpmccormick / datasourceaccess_token.php
Created May 19, 2012 10:02
Custom DS for Symphony CMS – add Facebook access token to param pool
<?php
require_once(TOOLKIT . '/class.datasource.php');
Class datasourceaccess_token extends Datasource{
function about(){
return array('name' => 'access token');
}
@davidpmccormick
davidpmccormick / gist:2556430
Created April 30, 2012 08:06
datasource.dynamic_json.php
<?php
require_once(TOOLKIT . '/class.gateway.php');
require_once(TOOLKIT . '/class.xsltprocess.php');
require_once(CORE . '/class.cacheable.php');
if(isset($this->dsParamURL)) $this->dsParamURL = $this->__processParametersInString($this->dsParamURL, $this->_env, true, true);
if(isset($this->dsParamXPATH)) $this->dsParamXPATH = $this->__processParametersInString($this->dsParamXPATH, $this->_env);
$stylesheet = new XMLElement('xsl:stylesheet');
@davidpmccormick
davidpmccormick / gist:2556419
Created April 30, 2012 08:05
class.json_to_xml.php
<?php
/**
* JSON to XML Converter
*
* @author Brent Burgoyne
* @link http://brentburgoyne.com
*/
class Json_to_xml
@davidpmccormick
davidpmccormick / gist:2556382
Created April 30, 2012 07:58
facebook data datasource
<?php
require_once(TOOLKIT . '/class.datasource.php');
Class datasourcefacebookdata extends Datasource{
public $dsParamROOTELEMENT = 'facebookdata';
public $dsParamURL = 'https://graph.facebook.com/davidpmccormick/feed?access_token=240983112675860%7CXJ-2ylXI7gJWVUMmz1nPoBKy9Ik';
public $dsParamXPATH = '/';
public $dsParamCACHE = '30';