Skip to content

Instantly share code, notes, and snippets.

View cwparsons's full-sized avatar

cwparsons

View GitHub Profile
import React from 'react';
import PropTypes from 'prop-types';
import { render, Document, Page, Artboard, Text, View } from 'react-sketchapp';
import items from './items.json';
const groupLength = 2;
let groups = [];
for (var i = 0; i < items.length; i += groupLength) {
groups.push(items.slice(i, i + groupLength));

Keybase proof

I hereby claim:

  • I am cwparsons on github.
  • I am cparsons (https://keybase.io/cparsons) on keybase.
  • I have a public key whose fingerprint is FCCB DC0A 8EBB 7A7C 36B8 6A8F D7C7 AAF6 2F6F 686F

To claim this, I am signing this object:

@cwparsons
cwparsons / gtm-send-tag-to-multiple-tracking-ids.js
Last active June 22, 2018 18:34
Send an event to multiple
/**
* # Usage
*
* 1. On an individual tag, update the tag configuration to have a new *Field to set*.
* 2. Set the field name to `customTask`.
* 3. Create a new variable for the value using the *Custom JavaScript* variable type.
* 4. Use below for the custom JavaScript.
*/
function() {
@cwparsons
cwparsons / _Telemetry data.md
Last active July 10, 2018 23:52
Capture telemetry data within a gulp task.

We use the following to track gulp tasks in Google Analytics.

@cwparsons
cwparsons / _User-specific gulp tasks.md
Last active July 10, 2018 23:53
Allow other developers to create their own gulp tasks.

We use the following to allow developers to have their own specific gulp tasks.

@cwparsons
cwparsons / _User-specific gulp configuration.md
Last active July 10, 2018 23:53
User configuration for a gulpfile.

We use the following to allow different users or computers to have their own gulp configuration.

/**
* Add an event callback when pushing events to Google Tag Manager's datalayer.
* Also provides a fallback if Google Tag Manager is not available.
* @see https://www.simoahava.com/gtm-tips/use-eventtimeout-eventcallback/
*/
const GTM_CONTAINER_ID = 'GTM-XXXXX';
export default function dataLayerPush(
eventObject: { [key: string]: string | number },
$contextItem = Get-Item .
$importFilePath = Receive-File -Path "$($SitecoreDataFolder)\importredirects" -Description "Creates simple redirect items from a CSV file with columns Name,Path,Target" -OkButtonName "Import"
if($importFilePath -eq "cancel") {
Exit
}
$csv = Import-Csv $importFilePath
$csv | % {
$name = $_.Name
$path = $_.Path
<!DOCTYPE html>
<html>
<head>
<title>choices-react example</title>
<style>
body {
font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-size: 16px;
line-height: 1.4;
# Install
# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
# Install from macOS App Store
# Divvy
# Microsoft Remote Desktop
# Packages
brew install \
1password \