Skip to content

Instantly share code, notes, and snippets.

View lionneclement's full-sized avatar

Clément lionneclement

View GitHub Profile
import { createStore } from "https://framer.com/m/framer/store.js@^1.0.0"
import { useEffect, useState, ComponentType } from "react"
import {
HEADINGS,
formatHeadings,
formatTableOfContent,
} from "https://framer.com/m/Utils-WIyM.js"
// Made with love by Clément: https://lionneclement.com/
// Full tutorial: https://framermart.com/tutorial/how-to-create-table-of-contents-cms-collections-framer
// Create an array to store the data
const data = [['Image', 'Title']];
document.querySelectorAll('.dig-Card').forEach((card) => {
const image = card.querySelector('.dig-Card-Media__ratio img').getAttribute('src');
let title = card.querySelector('.dig-Truncate').textContent;
import type { ComponentType } from "react"
import { useEffect, useState } from "react"
const CAPTION_SIZE_FACTOR = 0.85
export const withCaptionAlignCenter = (Component): ComponentType => {
return (props: any) => {
const [originalFontSize, setOriginalFontSize] = useState(16)
useEffect(() => {
@lionneclement
lionneclement / gist:1fcaf61a029b2374468ee9ad791760d3
Created June 12, 2022 10:14
Delete all Git branches which have been merged
use "nano ~/.zshrc"
alias gitClean="git checkout main && git pull && git branch --merged main | grep -v '\* main' | xargs -n 1 git branch -d"