Skip to content

Instantly share code, notes, and snippets.

View juliomerisio's full-sized avatar

Julio Merisio juliomerisio

View GitHub Profile
@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]
 *
@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 / 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', () => {
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 / 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>
  • Learn how Canvas works
  • Learn how Create a scene
  • Learn how to Positining elements in a scene
  • Learn how to create 3D elements using code
  • Learn how to use 3D assets, textures, maps HDRIs
  • Learn how to interact based on events, click, scroll, drag
  • Learn how Animate elements - Frames
  • Learn how Map WebGL elements to DOM elements whilst scrolling
  • Learn how Preload and prerender textures (replicates AssetLoader)
  • Learn how Manage WebGL resources (create and destroy materials and geometries as needed)
@juliomerisio
juliomerisio / shadertoy.md
Created January 28, 2022 03:26 — forked from markknol/shadertoy.md
Shader cheatsheet (from shadertoy)

This help only covers the parts of GLSL ES that are relevant for Shadertoy. For the complete specification please have a look at GLSL ES specification

Language:

Version: WebGL 2.0
Arithmetic: ( ) + - ! * / %
Logical/Relatonal: ~ < > <= >= == != && ||
Bit Operators: & ^ | << >>
Comments: // /* */
Types: void bool int uint float vec2 vec3 vec4 bvec2 bvec3 bvec4 ivec2 ivec3 ivec4 uvec2 uvec3 uvec4 mat2 mat3 mat4 mat?x? sampler2D, sampler3D samplerCube
Format: float a = 1.0; int b = 1; uint i = 1U; int i = 0x1;

@juliomerisio
juliomerisio / actionlist.vim
Created April 4, 2021 14:04 — forked from zchee/actionlist.vim
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>
@juliomerisio
juliomerisio / cloudSettings
Created February 21, 2021 18:20
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-02-21T18:20:37.642Z","extensionVersion":"v3.4.3"}
@juliomerisio
juliomerisio / index.ts
Created February 20, 2021 01:42
Require.context example
function getFileNames() {
return require.context(
'./',
true,
process.env.NODE_ENV === 'production' ? /\.js$/ : /\.ts$/
)
}
const context = getFileNames()
const files = context