Skip to content

Instantly share code, notes, and snippets.

@timhettler
timhettler / PivtoTable.js
Created Oct 7, 2020
Create a look up for a table with key value pairs
View PivtoTable.js
function pivotTable(table) {
const map = new Map();
table.forEach(row => { map.set(row.key, row.value); })
return map
}
@timhettler
timhettler / DeployToNetlify.js
Last active Oct 7, 2020
Trigger a Netlify Webhook
View DeployToNetlify.js
function onOpen() {
SpreadsheetApp.getUi()
.createMenu('Site')
.addItem('Deploy to Netlify', 'callNetlifyToDeploy')
.addToUi()
}
function callNetlifyToDeploy() {
var data = {}
View ModernReset.css
/* https://dev.to/hankchizljaw/a-modern-css-reset-6p3 */
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Remove default padding */
@timhettler
timhettler / BaseSvg.js
Last active Sep 27, 2019
A component that gives SVGs a consistent API
View BaseSvg.js
import React from 'react'
import PropTypes from 'prop-types'
const BaseIcon = ({ viewBox, height, width, type, children, ...rest }) {
// We want the default dimensions to be 100%, which covers most
// use-cases, but only if BOTH the width and height props are not set
const trueWidth = width || height ? width : '100%'
const trueHeight = width || height ? height : '100%'
return (
@timhettler
timhettler / settings.json
Last active Jun 10, 2019
Sublime Settings
View settings.json
{
"binary_file_patterns":
[
".DS_Store",
"build/*",
"dist/*",
"node_modules/",
"tmp/",
"*.png", "*.psd", "*.jpg", "*.jpeg", "*.png", "*.gif", "*.ttf", "*.tga", "*.dds", "*.ico", "*.eot", "*.pdf", "*.swf", "*.jar", "*.zip", "*.ai",
"*.min.*"
@timhettler
timhettler / flex-grid.scss
Last active Jan 11, 2018
A configurable grid system using flexbox
View flex-grid.scss
$size--content: 1080px;
$size--column-gutter: 16px;
$size--columns: 8;
@function fluid-width($span) {
@return calc(#{percentage($span/$size--columns)} - #{$size--column-gutter});
}
.container {
margin: 0 $size--column-gutter * 2;
@timhettler
timhettler / SassMeister-input-HTML.html
Last active Nov 9, 2015
Generated by SassMeister.com.
View SassMeister-input-HTML.html
<div class="container">
<div class="container__item">
<div class="fpo--tomato"></div>
</div>
<div class="container__item">
<div class="fpo--deeppink"></div>
</div>
<div class="container__item">
<div class="fpo--seagreen"></div>
</div>
@timhettler
timhettler / SassMeister-input-HTML.html
Last active Nov 3, 2015
Generated by SassMeister.com.
View SassMeister-input-HTML.html
<div class="container">
<div class="fpo"></div>
<div class="fpo"></div>
<div class="fpo"></div>
</div>
@timhettler
timhettler / SassMeister-input-HTML.html
Last active Oct 23, 2015
Generated by SassMeister.com.
View SassMeister-input-HTML.html
<div class="container">
<div class="fpo"></div>
<div class="fpo"></div>
<div class="fpo"></div>
</div>
@timhettler
timhettler / SassMeister-input-HTML.html
Created Oct 19, 2015
Generated by SassMeister.com.
View SassMeister-input-HTML.html
<div class="placeholder-image"></div>
You can’t perform that action at this time.