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 minute = 60; | |
const hour = minute * 60; | |
const day = hour * 24; | |
const week = day * 7; | |
const month = day * 30; | |
const year = day * 365; | |
/** | |
* Convert a date to a relative time string, such as | |
* "a minute ago", "in 2 hours", "yesterday", "3 months ago", etc. |
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 INTERCOM_KEY = /* YOUR KEY HERE */; | |
export function IntercomFacade() { | |
return ( | |
<div className="intercom-lightweight-app" aria-live="polite"> | |
<style>{INTERCOM_STYLE}</style> | |
<div | |
className="intercom-lightweight-app-launcher intercom-launcher" | |
role="button" | |
tabIndex={0} |
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 React from 'react'; | |
import { withBuilder } from '@builder.io/react'; | |
class CloudinaryImageComponent extends React.Component { | |
render() { | |
return <img src={this.props.image} /> | |
} | |
} | |
export const CloudinaryImage = withBuilder(CloudinaryImageComponent, { |
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
// An adaptor for binding Ractive.js views with nested Backbone models and collections via | |
// backbone-associations (https://github.com/dhruvaray/backbone-associations) | |
// | |
// Based on the original Backbone adaptor for Ractive by Rich Harris: | |
// https://github.com/Rich-Harris/Ractive/blob/master/src/Ractive/Ractive.adaptors/backbone.js | |
Ractive.adaptors.backboneAssociatedModel = function ( model, path ) { | |
var settingModel, settingView, setModel, setView, pathMatcher, pathLength, prefix, modelChangeEventHandler; | |
if ( path ) { |
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
{ "entities" : [ | |
{ | |
"key" : "http://hostname/test1.jpg", | |
"media_key": null, | |
"origin_urls" : ["http://hostname/page.html"] | |
}, | |
{ | |
"key" : "http://hostname.test2.jpg", | |
"media_key": null, | |
"origin_urls" : ["http://hostname/page2.html"] |
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
// My current grunt.js file, includes examples for compiling less, | |
// handlebars templates, file watching, etc | |
// | |
// My most used task is the "watch-serve" task for linting/testing | |
// my files as I work, has been amazingly helpful | |
// | |
// Comments below are the boilerplate comments from the original gruntfile | |
// I modified | |
// | |
// NOTE: for this to work you need to install the below npm tasks |