Skip to content

Instantly share code, notes, and snippets.

View mattlo's full-sized avatar
🎯
Focusing

Matt Lo mattlo

🎯
Focusing
View GitHub Profile
@mattlo
mattlo / snippet.html
Created October 19, 2018 18:38
Open ChipBot On Page Load
<script type="text/javascript">
window.onChipbotReady = () => {
window.chipBotApi.open();
}
</script>
import React, {Component, Fragment} from 'react';
import PropTypes from 'prop-types';
import {Icon} from '@blueprintjs/core';
import {css, keyframes} from 'emotion';
import classnames from 'classnames';
export const hoverStyle = css`
&:hover .clipboard-btn {
visibility: visible;
opacity: 1;
@mattlo
mattlo / bind.js
Last active December 14, 2017 21:46
function a(b) {
console.log(b);
}
a(1234); // 1234
const c = a.bind(null, 5678); // Function a ...
c(); // 5678
{
"id": "8PT597110X687430LKGECATA",
"create_time": "2013-06-25T21:41:28Z",
"resource_type": "authorization",
"event_version": "1.0",
"event_type": "PAYMENT.AUTHORIZATION.CREATED",
"summary": "A payment authorization was created",
"resource": {
"id": "I-1TJ3GAGG82Y9",
"state": "Active",
@mattlo
mattlo / README.md
Last active July 6, 2023 07:44
AEM 6.2 Touch UI Rich Text Editor Inline Dialog; Coral UI, RTE, CQ5, CUI, RichText

Example config for RTE within a Dialog

  • rtePlugins enables the CUI registry (cq/ui/rte/core/plugins/PluginRegistry.js)
    • Some plugins are enabled be default, so there's instances online where this section is omitted. You'll need this configuration if you want anything that isn't default. I left some other plugin configurations here that aren't in use.
  • uiSettings is a configuration used by CUI
    • Some online resources will note other cui children. inline is the configuration plugin for the inline toolbar mode. fullscreen is the configuration plugin for the full screen toolbar mode. If a plugin isn't enabled, some settings here won't activate.
  • Fixed inline mode won't work for 6.0 or 6.1. You'll need 6.2. In 6.3+, this may not work due to CUI2 being introduced. CUI2 may simplify some setup.

table

@mattlo
mattlo / post.md
Last active August 17, 2017 15:47
First time hand coding SVG into an animation

Playing around with SVG spec

svg0

Animated

svg1

Since I wanted to reduce JS dependencies to keep the bundle size small, I figured I try this in CSS

svgcss

Production use caes

done

Source

https://codepen.io/mattlo/pen/yopewO

@mattlo
mattlo / a.md
Last active June 13, 2017 20:55
Escaped back ticks

`${helloWorld}`

const `${helloWorld}`;
{user.id ? (
<div>
{user.firstName}!
</div>
) : 'You are not logged in!'}
@mattlo
mattlo / install.sh
Last active May 2, 2016 17:42
Install v4.4.3 NodeJS on Linux
v="4.4.3"
url="https://nodejs.org/dist/v$v/node-v$v-linux-x64.tar.gz"
wget $url
tar -C /usr/local --strip-components 1 -xzf "node-v$v-linux-x64.tar.gz"
ls -l /usr/local/bin/node
ls -l /usr/local/bin/npm
@mattlo
mattlo / impl.js
Last active April 18, 2016 21:06
React Tabs /w Redux
import './VideoInfo.scss';
import React from 'react';
import Tabs from '../Tabs/Tabs';
import TabsItem from '../Tabs/TabsItem';
export default class VideoInfo extends React.Component {
render() {
return (
<div>
<Tabs id="videoInfoTab">