Skip to content

Instantly share code, notes, and snippets.

View ichim-david's full-sized avatar

Ichim David ichim-david

View GitHub Profile
@ichim-david
ichim-david / addon-config.js
Last active September 24, 2024 16:30
Enable Volto Slate Advanced Link plugin
import installLink from '@plone/volto-slate/editor/plugins/AdvancedLink';
const applyConfig = (config) => {
config = installLink(config);
const toolbarButtons = config.settings.slate.toolbarButtons || [];
const linkIndex = toolbarButtons.indexOf('link');
const advancedLinkIndex = toolbarButtons.indexOf('a');
// replace original link plugin with "a" advanced plugin
toolbarButtons.splice(linkIndex, 1, 'a');
@ichim-david
ichim-david / fastmod.sh
Created September 21, 2024 08:40
fast replace of code codemod style from https://github.com/sourcegraph/cody/pull/5648
fastmod -e ts,tsx "import \{ (\w+) \} from 'lodash'" "import \$1 from 'lodash/\$1'"
@ichim-david
ichim-david / create_pr.sh
Created September 14, 2024 10:44 — forked from slavingia/create_pr.sh
Create a (draft) pull request using GitHub CLI
#!/bin/bash
# Create a (draft) pull request using GitHub CLI.
# It assigns the PR to the current user, fills in the title from the first commit,
# and uses the PR template file for the description.
set -euo pipefail
# Colors for output
RED='\033[0;31m'

Creating New Mutations and Queries

Follow these steps in order, using existing files as references:

  1. Update Schema

    • Edit packages/db/prisma/schema.prisma
    • Run prisma generate and prisma db push
    • Reference: Existing models in schema.prisma
You are an helpful assistant that primarily focuses on producing clear, readable code in sctrict Typescript, React and Next.js.
When you are asked to write code, you should always write code in strict Typescript, React and Next.js.
You should always use the latest version of the language and framework you are asked to use.
You also use latest versions of Tailwind CSS and React-Query, Auth.js, and Prisma.
You are also a helpful assistant that is always ready to help you with your questions.
You are an expert AI programming assistant that primarily focuses on producing clear, readable Typescript and Javascript code.
You always use the latest version of Typescript, Javascript, React, and Next, and you are familiar with the latest features and best practices.
You carefully provide accurate, factual, thoughtful answers, and excel at reasoning.
- Follow the user’s requirements carefully & to the letter.
- First think step-by-step - describe your plan for what to build in pseudocode, written out in great detail.
- Confirm, then write code!
- Always write correct, up to date, bug free, fully functional and working, secure, performant and efficient code.
@ichim-david
ichim-david / .cursorrules
Created July 20, 2024 11:48 — forked from Shpigford/.cursorrules
Cursor Rules
# Original instructions: https://forum.cursor.com/t/share-your-rules-for-ai/2377/3
You are an expert AI programming assistant that primarily focuses on producing clear, readable SwiftUI code.
You always use the latest version of SwiftUI and Swift, and you are familiar with the latest features and best practices.
You carefully provide accurate, factual, thoughtful answers, and excel at reasoning.
- Follow the user’s requirements carefully & to the letter.
- First think step-by-step - describe your plan for what to build in pseudocode, written out in great detail.
@ichim-david
ichim-david / my-ts-monorepo.md
Created June 7, 2024 06:56 — forked from manzt/my-ts-monorepo.md
A minimal setup for TypeScript monorepo libraries

My Minimal TypeScript Monorepo Setup for ESM Libraries

After a deep dive looking up best practices for TypeScript monorepos recently, I couldn't find anything that suited my needs:

  1. Publish individual (typed) packages to NPM with minimal config.
  2. Supports fast unit testing that spans the entire project (e.g., via Vitest)
  3. Ability to have an interactive playground to experiment with the API in a real-time (e.g., via Vite)

Most solutions point to TypeScript project references,

@ichim-david
ichim-david / README.md
Created June 1, 2024 06:09 — forked from pigeonflight/README.md
displaying images in on content types in volto both for individual items and listing views

I have a committee content type defined using xml on the Plone backend. The path to the xml would be something like: mysite.content.src.mysite.content.content.committee.xml

<model xmlns:easyform="http://namespaces.plone.org/supermodel/easyform"
xmlns:form="http://namespaces.plone.org/supermodel/form"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
xmlns:indexer="http://namespaces.plone.org/supermodel/indexer"
xmlns:lingua="http://namespaces.plone.org/supermodel/lingua"
xmlns:marshal="http://namespaces.plone.org/supermodel/marshal"

Maintainer needed

I have gotten to a point now where I realize my open source work is not sustainable in combination with family. I have spent a ton of time over the years developing ideas, learning, sharing and engaging with the open source community. It has been a lot of fun, but also exhausting. There is a dark side to doing open source, at least for me. Even though it is a recipe for learning I have also been spending most of my time lost in thought. Thinking about ideas, issues and craving recognition for the stuff that I share. It is not a healthy way to live your life. The cost/benefit was okay for a long time as the only people who were affected by it was my partner and myself, but now with 2 kids I have to stop... I should have stopped when we had our first kid. Sitting for 30 min next to our 4 year old daughter and not even noticing it, because I am working out this new idea in my head. Being impatient and annoyed at our 10 month year old son, because I am amped up by some bug I can not stop thin