Skip to content

Instantly share code, notes, and snippets.

@klase
klase / gist:4842e4b72501528bb7503f56581f0d8b
Created September 23, 2022 17:30
Embargo custom button
<script>
(function () {
const insertButtons = (containerNode) => {
containerNode
.querySelectorAll(".fixr-event-item__footer")
.forEach((node) => {
if (node.querySelector("[data-external-button]")) return;
const item = node.firstChild.cloneNode(true);
item.style.marginRight = "auto";
@klase
klase / gist:59e1d29ed3703523c86f402d2205fceb
Created July 26, 2019 10:53
Netlify CMS auth cloud function
const express = require("express");
const simpleOauth = require("simple-oauth2");
const randomstring = require("randomstring");
const oauth_provider = "github";
function getScript(mess, content) {
return `<!doctype html><html><body><script>
(function() {
function receiveMessage(e) {
@klase
klase / portal.jsx
Created June 20, 2019 21:20
React portal component
import React, { useState, useEffect, useRef } from "react";
import ReactDOM from "react-dom";
const Portal = ({ children }) => {
const [attachedToDom, setAttachedToDom] = useState(false);
const el = useRef(null);
useEffect(() => {
el.current = document.createElement("div");
document.body.appendChild(el.current);
{
"rules": {
"block-no-empty": true,
"color-no-invalid-hex": true,
"declaration-colon-space-after": "always",
"declaration-colon-space-before": "never",
"function-comma-space-after": "always",
"function-url-quotes": "always",
"media-feature-colon-space-after": "always",
"media-feature-colon-space-before": "never",
@klase
klase / touch-button.js
Created November 18, 2012 21:36 — forked from phoboslab/touch-button.js
Touch Button Plugin for Impact
ig.module(
'plugins.touch-button'
)
.requires(
'impact.system',
'impact.input',
'impact.image'
)
.defines(function(){