Skip to content

Instantly share code, notes, and snippets.

View alexcraviotto's full-sized avatar
🍀
Focusing

Alex Craviotto alexcraviotto

🍀
Focusing
View GitHub Profile
@alexcraviotto
alexcraviotto / kitty.conf
Created November 23, 2023 18:56
My kitty config
term xterm-256color
background_opacity 1.0
# font configurations
font_family JetBrainsMono Nerd Font
font_size 11.0
bold_font auto
italic_font auto
bold_italic_font auto
disable_ligatures never
@alexcraviotto
alexcraviotto / FeatureSection.tsx
Last active July 12, 2023 00:28
Feature Section Component Built with Tailwind
import Image from "next/image";
export enum Position {
LEFT,
RIGHT,
}
interface IFeatureSection {
illustrationPath: string;
title: string;
@alexcraviotto
alexcraviotto / generateRandomString.ts
Created February 11, 2022 13:18
A simple method to generate random strings with TypeScript
export const generateRandomString = (length: number):string => {
const allCaps: string[] = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P", "Q","R","S","T","U","V","W","X", "Y","Z"]
const allLower: string[] = allCaps.map(letter => letter.toLowerCase())
const alphabet: string[] = [...allCaps, ...allLower]
let output: string= ""
for(let i = 0; i < length; i++){
output += (alphabet[Math.floor(Math.random() * (alphabet.length + 1))])
}
@alexcraviotto
alexcraviotto / bubbleSort.ts
Created February 2, 2022 19:55
Bubble Sort implemented with TypeScript
export const bubbleSort = (array: number[]): number[] => {
let aux: number;
for(let i = 1; i < array.length; i++){
for(let j = 0; j < array.length - i; j++){
if(array[j] > array[j+1]){
aux = array[j];
array[j] = array[j+1];