Skip to content

Instantly share code, notes, and snippets.

@izoukhai
izoukhai / DirectusInput.tsx
Last active November 1, 2023 15:47
Generate forms from Directus CMS and render them with NextJS
"use client";
import { FieldValues, UseFormProps, UseFormReturn } from "react-hook-form";
import { ApiCollections } from "../../../@types/api";
export const DirectusInput = (props: {
element: ApiCollections["form_components"];
hookForm: UseFormReturn<FieldValues, any>;
}) => {
const { element, hookForm } = props;
@AndruC
AndruC / Roll20 Macros.md
Last active May 4, 2024 14:50
Macros that I use to improve my D&D games

Macro Must-Haves

These are my must-have macros for running games online. I make full use of the compendium, which gives these macros access to common actions and rolls, saving me time.

Remember to add /w gm or @{selected|wtype} to hide sensitive info from your players. WTYPE is an attribute used in the 5th Edition OGL character sheet, a prerequisite for most of these.

Here's what my bar looks like.

Macro Quickbar

WEBGL // p5 WEBGL rendering mode.
createCanvas(w, h, renderer) // Creates a 3D canvas (if renderer is WEBGL).
// Primitives
plane(width, height) // Creates a plane in 3D space. Equivalent to rect() in the default rendering mode.
plane(width, height, detailX, detailY) // Creates a plane in 3D space with the number of triangle subdivisions specified.
box(width) // Creates a cube in 3D space.
box(width, height, depth) // Creates a cuboid in 3D space.
box(width, height, depth, detailX, detailY) // Creates a cuboid in 3D space with triangle subdivisions.
sphere(radius) // Creates a sphere in 3D space.
@eloytoro
eloytoro / webpack.config.js
Created December 18, 2016 23:24
Compile HTML so everything's inlined
const fs = require('fs');
const HtmlPlugin = require('html-webpack-plugin');
const path = require('path')
// webpack.config.js
module.exports = {
output: {
path: './build', // This is where images AND js will go
publicPath: '/',
filename: '[name].html'
var p1={
x:0,
y:0
};
var p2={
x:0,
y:1
};
@andypiper
andypiper / basic-recipes.md
Last active September 5, 2022 14:53
Twitter API recipes for twurl +jq, and other useful Twitter code snippets and tools