Skip to content

Instantly share code, notes, and snippets.

@mjbalcueva
mjbalcueva / password-input.tsx
Last active January 3, 2025 23:23
shadcn ui custom password input
'use client'
import * as React from 'react'
import { EyeIcon, EyeOffIcon } from 'lucide-react'
import { Button } from '@/components/ui/button'
import { Input, type InputProps } from '@/components/ui/input'
import { cn } from '@/lib/utils'
const PasswordInput = React.forwardRef<HTMLInputElement, InputProps>(({ className, ...props }, ref) => {
@rylev
rylev / learn.md
Created March 5, 2019 10:50
How to Learn Rust

Learning Rust

The following is a list of resources for learning Rust as well as tips and tricks for learning the language faster.

Warning

Rust is not C or C++ so the way your accustomed to do things in those languages might not work in Rust. The best way to learn Rust is to embrace its best practices and see where that takes you.

The generally recommended path is to start by reading the books, and doing small coding exercises until the rules around borrow checking become intuitive. Once this happens, then you can expand to more real world projects. If you find yourself struggling hard with the borrow checker, seek help. It very well could be that you're trying to solve your problem in a way that goes against how Rust wants you to work.

@soderlind
soderlind / dropzonejs-wp-rest-api.js
Last active January 3, 2025 23:21
DropzoneJS & WordPress REST API
/*
Uploading images is a two step process (from https://github.com/WP-API/WP-API/issues/1768#issuecomment-160540932):
POST the data to /wp/v2/media - this can either be as the request body, or in multipart format. This will upload the file, and give you a 201 Created response with a Location header. This header points to the post object for the attachment that has just been created.
PUT the post data to the endpoint returned in the Location header (which will look something like /wp/v2/media/{id}).
I do step 2 (PUT), if POST is a success, in myDropzone.on("success", function(file, response){}
*/
// dropzoneWordpressRestApiForm is the configuration for the element that has an id attribute
@danielhe4rt
danielhe4rt / teste-foda.md
Last active January 3, 2025 23:20
Teste Técnico: Crie seu Discord!

Teste Tecnico: Desenvolvimento de uma Aplicação de Chat em Tempo Real com PHP e Laravel (ou qualquer outra lang)

Introdução

Neste desafio, você será responsável por desenvolver uma aplicação de chat em tempo real utilizando PHP e o framework Laravel. A aplicação deve oferecer funcionalidades básicas similares às encontradas em plataformas de chat como o Discord. O foco principal é a criação de um backend robusto e escalável, utilizando as abstrações e boas práticas do Laravel.

Requisitos do Projeto

Funcionalidades Principais

@MuhammadSaim
MuhammadSaim / rarreg.key
Last active January 3, 2025 23:14
Step 1: Create a file called rarreg.key Step 2: Paste into the file the raw content of this gist Step 3: Go to Winrar install directory (by default => c:\ProgramFiles\WinRAR\ ) Step 4: Paste the rarreg.key into WinRAR directory Step 5: Enjoy
RAR registration data
WinRAR
Unlimited Company License
UID=4b914fb772c8376bf571
6412212250f5711ad072cf351cfa39e2851192daf8a362681bbb1d
cd48da1d14d995f0bbf960fce6cb5ffde62890079861be57638717
7131ced835ed65cc743d9777f2ea71a8e32c7e593cf66794343565
b41bcf56929486b8bcdac33d50ecf773996052598f1f556defffbd
982fbe71e93df6b6346c37a3890f3c7edc65d7f5455470d13d1190
6e6fb824bcf25f155547b5fc41901ad58c0992f570be1cf5608ba9
@deepfates
deepfates / convert_archive.py
Created November 17, 2024 19:33
Convert your twitter archive into a training dataset and markdown files
import argparse
import json
import logging
import os
import re
import shutil
from concurrent.futures import ProcessPoolExecutor, as_completed
from dataclasses import dataclass
from datetime import datetime
from typing import Any, Callable, Dict, List, Literal, Optional, Tuple
@StartAutomating
StartAutomating / EventBasedServer.ps1
Last active January 3, 2025 23:10
Gist a small event-based HTTP server in PowerShell
$JobName = "http://localhost:$(Get-Random -Min 4200 -Max 42000)/"
$httpListener = [Net.HttpListener]::new()
$httpListener.Prefixes.Add($JobName)
$httpListener.Start()
Start-ThreadJob -ScriptBlock {
param($MainRunspace, $httpListener, $SourceIdentifier = 'http')
while ($httpListener.IsListening) {
$contextAsync = $httpListener.GetContextAsync()
while (-not ($contextAsync.IsCompleted -or $contextAsync.IsFaulted -or $contextAsync.IsCanceled)) {}
@Klerith
Klerith / pasos-node-typescript.md
Last active January 3, 2025 23:09
Configurar proyecto de Node con TypeScript

Pasos para usar Node con TypeScript con Nodemon

Más información - Docs Oficiales

  1. Instalar TypeScript y tipos de Node, como dependencia de desarrollo
npm i -D typescript @types/node
  1. Inicializar el archivo de configuración de TypeScript ( Se puede configurar al gusto)
@paulopatto
paulopatto / WinKeys.txt
Created November 8, 2023 00:04 — forked from letsgoawaydev/WinKeys.txt
Windows Product Keys
``````````````````````````````````````````
Windows Product Keys for Getting Past Setup
Windows XP - Windows 11
Home product keys are currently not added.
THESE WILL ONLY HELP YOU GET PAST SETUP AND WILL NOT
ACTIVATE WHEN YOU CONNECT TO THE INTERNET. THESE JUST
LET YOU INSTALL WINDOWS TO YOUR HARDDISK UNACTIVATED
``````````````````````````````````````````
@nosilver4u
nosilver4u / frt-tweaks.php
Last active January 3, 2025 23:04
Force Regenerate Thumbnails Tweaks
<?php
/*
Plugin Name: Force Regenerate Thumbnails Tweaks
Version: 1.0.0
*/
// NOTE: This plugin will do nothing without alterations. Uncomment the add_filter() lines for the filters you wish to use.
// If necessary, edit them to your needs. Some filters simply turn things on/off by returning a true or false.
// For such filters, using WordPress' built-in __return_true() or __return_false() functions will work just fine, unless
// you wish to conditionally enable/disable a feature.