Skip to content

Instantly share code, notes, and snippets.

@joao-coimbra
joao-coimbra / auto-organize-downloads.py
Last active November 22, 2024 17:37
organize your downloads folder
import os
import shutil
def organize_folder(folder):
file_types = {
'Images': ['.jpeg', '.jpg', '.png', '.gif', '.svg'],
'Videos': ['.mp4', '.avi', '.mov'],
'Documents': ['.pdf', '.docx', '.txt'],
'Programs': ['.exe', '.msi'],
'Archives': ['.zip', '.rar']
@joao-coimbra
joao-coimbra / _reset.scss
Created June 12, 2024 16:33
remove all the styles of the "User-Agent-Stylesheet", except for the 'display' property
/***
The new CSS reset - version 1.9 (last updated 19.6.2023)
GitHub page: https://github.com/elad2412/the-new-css-reset
***/
/*
Remove all the styles of the "User-Agent-Stylesheet", except for the 'display' property
- The "symbol *" part is to solve Firefox SVG sprite bug
- The "html" element is excluded, otherwise a bug in Chrome breaks the CSS hyphens property (https://github.com/elad2412/the-new-css-reset/issues/36)
*/
@joao-coimbra
joao-coimbra / smooth-gradient.scss
Created June 12, 2024 14:33
create a smooth gradient with sass function
@function smooth-gradient($direction: 0deg, $color: hsl(0, 0%, 0%)) {
@return linear-gradient(
$direction,
color.change($color, $alpha: 1) 0%,
color.change($color, $alpha: 0.738) 19%,
color.change($color, $alpha: 0.541) 34%,
color.change($color, $alpha: 0.382) 47%,
color.change($color, $alpha: 0.278) 56.5%,
color.change($color, $alpha: 0.194) 65%,
color.change($color, $alpha: 0.126) 73%,
import { z } from "zod";
const nodeEnv = z.enum(["development", "production"]);
function requiredOn(env: z.infer<typeof nodeEnv>) {
return (value: any) => !(env === process.env.NODE_ENV && !value);
}
const envSchema = z.object({
NODE_ENV: nodeEnv.default('development'),
@joao-coimbra
joao-coimbra / settings.json
Last active March 22, 2024 13:53
vscode settings
{
"workbench.startupEditor": "newUntitledFile",
"editor.fontSize": 14,
"editor.lineHeight": 1.8,
"javascript.suggest.autoImports": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"editor.rulers": [80, 120],
"extensions.ignoreRecommendations": true,
"typescript.tsserver.log": "off",
"files.associations": {