Skip to content

Instantly share code, notes, and snippets.

@peduarte
peduarte / search.tsx
Last active February 17, 2024 19:34
Raycast: YouTube Count Command
import { Action, ActionPanel, Grid, List, getPreferenceValues } from "@raycast/api";
import { useFetch } from "@raycast/utils";
import { htmlUnescape } from "escape-goat";
const YOUTUBE_API_KEY = "";
const CHANNEL_ID = "";
type Snippet = {
title: string;
thumbnails: {
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts@4.6.0/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts@4.6.0/access/Ownable.sol";
contract RainbowKitNFT is ERC1155, Ownable {
uint256 public totalSupply;
constructor() ERC1155("https://rainbowkit-mint-nft-demo.vercel.app/nft.json") {}
@peduarte
peduarte / esnextbin.md
Last active August 25, 2022 14:55
Vanilla Debounce
//https://cdn.jsdelivr.net/gh/fatbattk/dom-confetti@master/src/main.js
const defaultColors = ['#a864fd', '#29cdff', '#78ff44', '#ff718d', '#fdff6a'];
function createElements(root, elementCount, colors, image, width, height) {
return Array.from({ length: elementCount }).map((_, index) => {
const element = document.createElement('div');
element.style.width = width;
element.style.height = height;
element.style.position = 'absolute';
element.style.willChange = 'transform, opacity';
@peduarte
peduarte / radix-colors-1.md
Last active May 15, 2021 19:32
Radix Colors API Proposal 1

For CSS-in-JS (with tree-shaking):

  • import all colors in light and dark modes
  • import all colors in a specific mode
  • import a specific scale in light and dark modes
  • import a specific scale in a specific mode
  • import a specific token in light and dark modes
  • import a specific token in a specific mode
  • make sure the integration with Stitches is as smooth as possible

import all colors in light and dark modes

@peduarte
peduarte / radix-colors-2.md
Last active May 15, 2021 19:29
Radix Colors API Proposal 2

For CSS-in-JS (with tree-shaking):

  • import all colors in light and dark modes
  • import scales in light and dark modes
  • import tokens in light and dark modes
  • make sure the integration with Stitches is as smooth as possible

import all colors in light and dark modes

import { colors, darkColors } from '@radix-ui/colors'
@peduarte
peduarte / box.tsx
Created April 19, 2021 21:36
Legacy Primitives Box
import styled from 'styled-components';
import {
border,
BorderProps,
borderRadius,
BorderRadiusProps,
boxShadow,
BoxShadowProps,
backgroundColor,
BackgroundColorProps,
@peduarte
peduarte / esnextbin.md
Last active February 18, 2021 21:35
Vanilla Throttle
@peduarte
peduarte / modernizr.sizingvalues.js
Last active August 31, 2018 03:20
Modernizr CSS3 Sizing Values check (min-content, max-content, fill-content, fill-available)
(function(Modernizr) {
'use strict';
/**
* Modernizr test to check if CSS3 Sizing values are supported
* W3: http://www.w3.org/TR/css3-sizing/
* CanIUse: http://caniuse.com/#feat=intrinsic-width
*
* Values to check: