Skip to content

Instantly share code, notes, and snippets.

View alishahlakhani's full-sized avatar
🤘
Busy Inventing the future

Ali Shah Lakhani alishahlakhani

🤘
Busy Inventing the future
View GitHub Profile
@alishahlakhani
alishahlakhani / madeofzero-nextjs-framer-flip-card.tsx
Last active August 23, 2024 14:22
Create a Tarot card deck selection page using Framer Motion and Nextjs
"use client";
import React, { useState } from "react";
import { AnimatePresence, motion } from "framer-motion";
import Image from "next/image";
import clsx from "clsx";
type Props = {
onPick?: (card: string | null) => void;
onSelect?: (card: string) => void;
};
@DominikAngerer
DominikAngerer / multiupload.js
Created July 5, 2018 19:03
Simple multiupload field type for Storyblok
const Fieldtype = {
mixins: [window.Storyblok.plugin],
template: `
<div class="uk-clearfix">
<input class="uk-hidden" type="file" multiple="multiple" @change="changeFiles($event)" />
<div class="uk-flex uk-margin-small-bottom" v-for="(key, item) in model.files">
<img class="image" :src="item.url.replace('a.storyblok.com', 'img2.storyblok.com/160x90/filters:fill(auto,0)')">
<input type="text" class="uk-form-small uk-flex-item-auto" v-model=item.url>
<button @click.prevent="removeFile(key)" class="uk-button uk-button-small uk-margin-small-left"><i class="uk-icon-close"></i></button>
@daveyjones
daveyjones / regenerate-thumbnails.js
Last active June 20, 2023 16:03
Insanely fast multi-core Node.js script for generating (or regenerating) custom WordPress image sizes (e.g. thumbnails) for very large media libraries
// Your server must have wp-cli installed (http://wp-cli.org/)
var async = require("async");
var exec = require("child_process").exec;
var cores = 32; // Adjust the number of cores to match your environment
var total = 0;
var finished = 0;
var q = async.queue(function(task, callback) {