Skip to content

Instantly share code, notes, and snippets.

View liampmccabe's full-sized avatar
👋

Liam McCabe liampmccabe

👋
View GitHub Profile
export interface SheetResponse {
range: string;
majorDimension: 'ROWS' | 'COLUMNS';
values: string[][];
}
export const mockBroadbandData: SheetResponse = {
range: 'Broadband!A2:E50',
majorDimension: 'ROWS',
values: [
function MasonryGrid(userOptions = {}) {
if (!(this instanceof MasonryGrid)) {
throw new Error('MasonryGrid must be called with new');
}
// Private state using WeakMap to maintain encapsulation
const privateState = new WeakMap();
privateState.set(this, {
expandedId: null,
isMobile: window.innerWidth < 768,
function MasonryGrid(userOptions = {}) {
if (!(this instanceof MasonryGrid)) {
throw new Error('MasonryGrid must be called with new');
}
// Private state using WeakMap to maintain encapsulation
const privateState = new WeakMap();
privateState.set(this, {
expandedId: null,
isMobile: window.innerWidth < 768,
function MasonryGrid(userOptions = {}) {
if (!(this instanceof MasonryGrid)) {
throw new Error('MasonryGrid must be called with new');
}
// Private state using WeakMap to maintain encapsulation
const privateState = new WeakMap();
privateState.set(this, {
expandedId: null,
isMobile: window.innerWidth < 768,
function MasonryGrid(userOptions = {}) {
if (!(this instanceof MasonryGrid)) {
throw new Error('MasonryGrid must be called with new');
}
// Private state using WeakMap to maintain encapsulation
const privateState = new WeakMap();
privateState.set(this, {
expandedId: null,
isMobile: window.innerWidth < 768,
function MasonryGrid(userOptions = {}) {
if (!(this instanceof MasonryGrid)) {
throw new Error('MasonryGrid must be called with new');
}
// Private state using WeakMap to maintain encapsulation
const privateState = new WeakMap();
privateState.set(this, {
expandedId: null,
isMobile: window.innerWidth < 768,
const element = webflow.elementBuilder(webflow.elementPresets.DOM);
await element.setTag('h1');
await element.setTextContent('Hello World')
await selectedElement.append(element);
const remixLocation = useLocation()
const [source, setSource] = useState<any>(null)
const [items, setItems] = useState<any[]>(layers ?? [])
const [activeLayer, setActiveLayer] = useState<any>(null)
/**
* Listen to popstate event and set active layer
*/
useEffect(() => {
import YouTube, { YouTubeProps } from "react-youtube"
import { useRef, useState } from "react"
import { Play, Pause } from "phosphor-react"
import { motion } from "framer-motion"
import { addPropertyControls, ControlType } from "framer"
export default function MusicPlayer(props) {
const [isPlaying, setIsPlaying] = useState(false)
const player = useRef()
@liampmccabe
liampmccabe / remix.js
Last active April 14, 2022 09:25
remix-uploads.js
// New.tsx
export const action: ActionFunction = async ({ request }) => {
const uploadHandler: UploadHandler = async ({ name, filename, stream }) => {
if (name !== "image") {
stream.resume();
return;
}
try {
const uploadedImage = await uploadImage(stream, filename);