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
/* modification of the logger https://github.com/mohitagrawal1305/nextjs-custom-logger/blob/main/helpers/logger.js */ | |
/* typescript and small fix for nextjs usage */ | |
/* use on your layout.tsx or high level provider | |
* declare global { | |
* interface Window { | |
* logger: any; | |
* } | |
* } |
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
// code is A.I generated, use with care | |
function isValidTaxId(taxId, country) { | |
let regex; | |
switch (country) { | |
case 'US': | |
// US EIN format: 00-0000000 | |
regex = /^(\d{2}-\d{7})$/; | |
break; | |
case 'DE': |
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 * as THREE from 'three' | |
import { useEffect, useRef } from 'react' | |
import { useThree } from '@react-three/fiber' | |
import { suspend, preload, clear } from 'suspend-react' | |
import Hls from 'hls.js' | |
export function useHLSVideoTexture(src, props) { | |
const { unsuspend, start, crossOrigin, muted, loop, ...rest } = { | |
unsuspend: 'loadedmetadata', | |
crossOrigin: 'Anonymous', |
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
// The class itself is based on the animation helper class in | |
// https://github.com/paulmg/ThreeJS-Webpack-ES6-Boilerplate | |
// but I have changed almost everything except for the class name and the update function. | |
import * as THREE from 'three'; | |
export default class Animation { | |
constructor(scene, animations) { | |
this.scene = scene; | |
this.animations = animations; |
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
#!/bin/bash | |
input_folder="C:\Users\..." | |
output_folder="C:\Users\..." | |
for file in "$input_folder"/*; do | |
if [[ -f "$file" ]]; then | |
filename=$(basename -- "$file") | |
extension="${filename##*.}" | |
filename="${filename%.*}" |
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 { ComponentType, useRef, useState } from "react" | |
import { useEffect } from "react" | |
import { createStore } from "https://framer.com/m/framer/store.js@^1.0.0" | |
import { randomColor } from "https://framer.com/m/framer/utils.js@^0.9.0" | |
import * as SupabaseJs from "https://jspm.dev/@supabase/supabase-js@rc" | |
import _ from "lodash" | |
// Learn more: https://www.framer.com/docs/guides/overrides/ | |
export const useStore = createStore({ | |
background: "#0099FF", |
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 { ComponentType, useRef, useState } from "react" | |
import { useEffect } from "react" | |
import { createStore } from "https://framer.com/m/framer/store.js@^1.0.0" | |
import { randomColor } from "https://framer.com/m/framer/utils.js@^0.9.0" | |
import * as SupabaseJs from "https://jspm.dev/@supabase/supabase-js@rc" | |
import _ from "lodash" | |
// Learn more: https://www.framer.com/docs/guides/overrides/ | |
export const useStore = createStore({ |
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
// Welcome to Code in Framer | |
// Get Started: https://www.framer.com/docs/guides/ | |
import { addPropertyControls, ControlType } from "framer" | |
import { ScrambleText } from "./ScrambleText.tsx" | |
/** | |
* These annotations control how your component sizes | |
* Learn more: https://www.framer.com/docs/guides/auto-sizing | |
* |
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 { useInterval } from "usehooks-ts" | |
export const ScrambleText = (props) => { | |
const { children, size } = props | |
if (typeof children !== "string") | |
throw new Error("Children of scramble text must be a single string") | |
const [scrambledText, setScrambledText] = React.useState( | |
scrambleText(children.slice(0, size)) |
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
export function getTotal(Component): ComponentType { | |
return (props) => { | |
const [store, setStore] = globalStore() | |
useEffect(() => { | |
var total = 0 | |
var selectedData = [] | |
_.forEach(store.selectedProducts, (item) => { | |
var filteredArray = _.filter( |
NewerOlder