Skip to content

Instantly share code, notes, and snippets.

@juliomerisio
juliomerisio / index.html
Created May 14, 2022 13:15
Trash button animation
<button class="button">
<div class="trash">
<div class="top">
<div class="paper"></div>
</div>
<div class="box"></div>
<div class="check">
<svg viewBox="0 0 8 6">
<polyline points="1 3.4 2.71428571 5 7 1"></polyline>
</svg>
import { z } from 'zod';
type SupportedLocales = 'en-US' | 'pt-BR';
export const dictionaries: Record<
SupportedLocales,
Record<string, Record<string, string>>
> = {
'en-US': {
common: {
@juliomerisio
juliomerisio / TransactionList.spec.tsx
Created February 7, 2023 22:27 — forked from AugustoCalaca/TransactionList.spec.tsx
test using relay hooks, relay-test-utils and react-testing-library
import React from 'react';
import { render, cleanup } from '@testing-library/react';
import { MockPayloadGenerator } from 'relay-test-utils';
import { useRelayEnvironment } from 'react-relay/hooks';
import TransactionList from '../TransactionList';
afterEach(cleanup);
describe('<TransactionList />', () => {
it('should reject query', () => {
@juliomerisio
juliomerisio / coveruv.glsl
Created January 29, 2024 12:39 — forked from supahfunk/coveruv.glsl
Cover UV / Contain UV
/*------------------------------
Background Cover UV
--------------------------------
u = basic UV
s = screensize
i = image size
------------------------------*/
vec2 CoverUV(vec2 u, vec2 s, vec2 i) {
float rs = s.x / s.y; // Aspect screen size
float ri = i.x / i.y; // Aspect image size
@juliomerisio
juliomerisio / readme.md
Created July 23, 2024 18:32 — forked from slava-vishnyakov/readme.md
How to upload images with TipTap editor
  1. Create a file Image.js from the source below (it is almost a copy of Image.js from tiptap-extensions except that it has a constructor that accepts uploadFunc (function to be called with image being uploaded) and additional logic if(upload) { ... } else { ... previous base64 logic .. } in the new Plugin section.
import {Node, Plugin} from 'tiptap'
import {nodeInputRule} from 'tiptap-commands'

/**
 * Matches following attributes in Markdown-typed image: [, alt, src, title]
 *