Skip to content

Instantly share code, notes, and snippets.

View carlos3g's full-sized avatar
💻
Coding with community

Carlos Mesquita carlos3g

💻
Coding with community
View GitHub Profile
@carlos3g
carlos3g / settings.json
Last active April 19, 2024 14:23
Setting that i use in my vs code
{
"[blade]": {
"editor.defaultFormatter": "shufo.vscode-blade-formatter"
},
"[java]": {
"editor.defaultFormatter": "redhat.java"
},
"[kotlin]": {
"editor.defaultFormatter": "fwcd.kotlin"
},
@carlos3g
carlos3g / .prettierrc
Last active December 26, 2020 13:07
My prettier basic config
{
"singleQuote": true,
"trailingComma": "es5",
"printWidth": 80,
"tabWidth": 2
}
@carlos3g
carlos3g / README.md
Last active February 9, 2022 18:05
my template for README.md files

repo-size
; This file is for unifying the coding style for different editors and IDEs.
; More information at https://editorconfig.org
root = true
[*]
insert_final_newline = true
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
@carlos3g
carlos3g / docker-reset.sh
Last active August 22, 2022 13:45
delete all containers, images and volumes from docker
#!/bin/bash
# ------------------------------------------------------------------------------
# author: Carlos Mesquita
# website: https://carlos3g.github.io
# ------------------------------------------------------------------------------
# This script will:
# - Stop all docker containers
# - Delete all stopped docker containers
# - Delete all docker images
# - Delete all docker volumes

Navegação

  • pwd
  • ls
  • tree
  • cat
  • tail
  • wc

outros

  • file
const DIGIT = '9';
const ALPHA = 'A';
const ALPHANUM = 'S';
const toPattern = (value: string, pattern: string): string => {
const resultArray = pattern.split('');
const values = value.split('');
let index = 0;
let i = 0;
@carlos3g
carlos3g / textToColor.ts
Created June 13, 2024 15:23
text to color | base 36 to 16
// see: https://www.charlie-coleman.com/experiments/1
export const textToColor = (unsafeColor: string): string => {
// Remove all non-alphanumeric characters and spaces
let color = unsafeColor.replace(/\s+/g, '').replace(/[^a-zA-Z0-9]+/g, '');
// Calculate required length and padding
const lengthC = color.length;
const amount = Math.ceil(lengthC / 3);
const add = amount * 3 - lengthC;
/**
* v0 by Vercel.
* @see https://v0.dev/t/uNOsfYuMiZR
* Documentation: https://v0.dev/docs#integrating-generated-code-into-your-nextjs-app
*/
import { Button } from "@/components/ui/button"
export default function Component() {
return (
<div className="max-w-2xl mx-auto px-4 py-8 sm:px-6 lg:px-8">