Skip to content

Instantly share code, notes, and snippets.

@jacobsamo
jacobsamo / convex-helpers.ts
Created December 24, 2025 08:57
I created this neat little helper function for defining tables for convex using zod, it utilises the convex-helpers (https://github.com/get-convex/convex-helpers) package for transforming zod into convex schemas, this apporach reduces code duplicated as well as reducing the change of missing a type or field in queries or mutations.
// convex/helpers.ts
import { NoOp } from "convex-helpers/server/customFunctions";
import {
zCustomAction,
zCustomMutation,
zCustomQuery,
} from "convex-helpers/server/zod4";
import { components } from "./_generated/api";
import type { Id } from "./_generated/dataModel";
import {
@nimone
nimone / Carousel.jsx
Last active October 15, 2025 03:38
Build a carousel component like instagram purely in ReactJS and TailwindCSS
@scf4
scf4 / index.js
Created July 5, 2017 19:30
[Draft.js plugins] How to force block style on first line for a heading/title like Medium
// Import and add to your Editor's plugins
import { RichUtils } from 'draft-js';
const HEADING = 'header-one';
export default () => ({
onChange: (editorState) => {
const currentContent = editorState.getCurrentContent();
const firstBlockKey = currentContent.getBlockMap().first().getKey();
@erikras
erikras / RichTextMarkdown.js
Created October 28, 2016 12:23
Using react-rte with redux-form
import React, { Component, PropTypes } from 'react'
class RichTextMarkdown extends Component {
static propTypes = {
input: PropTypes.shape({
onChange: PropTypes.func.isRequired,
value: PropTypes.string
}).isRequired
}
@at0g
at0g / autoform-datepicker-range.html
Last active February 1, 2016 13:16
An example of using aldeen:autoform with dual date pickers. There is custom validation where the endDate must be between 3 days and 3 weeks from the start date.
<head>
<title>Datepicker range example</title>
</head>
<body>
<h1>Welcome to Meteor!</h1>
<div class="container">
{{> thingsForm }}
</div>
@benstr
benstr / package-symlink-instructions.md
Created November 3, 2014 22:09
How to modify an Atmosphere package with forking and symlink
// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/
// 0. XPath Examples.
// More: http://xpath.alephzarro.com/content/cheatsheet.html
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class