Skip to content

Instantly share code, notes, and snippets.

View jorgeadev's full-sized avatar
Focusing

Jorge Gomez jorgeadev

Focusing
View GitHub Profile
class MethodClass:
@staticmethod
def factorial(number):
if number == 0:
return 1
else:
return number * MethodClass.factorial(number - 1)
factorial = MethodClass.factorial(5)
print(factorial)
class MethodTypes():
def __init__(self):
self.lastname = "Lothbrock"
self.name = "Ragnar"
def instanceMethod(self):
# Creates an instance atribute through keyword self
print(self.name)
print(self.lastname)
@jorgeadev
jorgeadev / MainActivity.kt
Last active June 25, 2025 22:10
First gist from Android Studio with Kotlin
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}
}
@jorgeadev
jorgeadev / layout-h-screen.tsx
Last active January 10, 2026 08:32
Tailwind layout screen full height
export default function HomePage() {
return (
<div className="min-h-screen flex flex-col h-screen">
<header className="bg-red-50">Header</header>
<div className="flex-1 flex flex-row overflow-y-hidden">
<main className="flex-1 bg-indigo-100 overflow-y-auto">Content here</main>
<nav className="order-first sm:w-32 bg-purple-200 overflow-y-auto">Sidebar</nav>
<aside className="sm:w-32 bg-yellow-100 overflow-y-auto">Right Sidebar</aside>
</div>
<footer className="bg-gray-100">Footer</footer>
@jorgeadev
jorgeadev / layout.tsx
Last active January 10, 2026 08:32
Example using custom fonts
import type { Metadata } from "next";
import localFont from "next/font/local";
import "../styles/globals.css";
import { ReactNode } from "react";
const excalifont = localFont({
src: "./fonts/excalifont-regular.woff",
variable: "--font-excalifont",
weight: "100 200 300 400 500 600 700 800 900 normal regular bold light italic",
});
"use client";
import { useEffect, useState } from "react";
import { IBreadcrumb } from "@/types";
import { BreadcrumbItem } from "@/components";
import { usePathname } from "next/navigation";
export const Breadcrumb = () => {
const pathname = usePathname();
const [breadcrumbs, setBreadcrumbs] = useState<IBreadcrumb[]>([]);
import { IBreadcrumbItem } from "@/types";
import { ReactNode } from "react";
import Link from "next/link";
export const BreadcrumbItem = ({ children, href, isRoot, isCurrent }: IBreadcrumbItem)
:
ReactNode => {
return (
<>
{ !isRoot && (<span className="opacity-50" aria-hidden="true">/</span>) }
<div class="min-h-screen flex flex-col">
<header class="bg-red-50">Header</header>
<div class="flex-1 flex flex-col sm:flex-row">
<main class="flex-1 bg-indigo-100">Content here</main>
<nav class="order-first sm:w-32 bg-purple-200">Sidebar</nav>
<aside class="sm:w-32 bg-yellow-100">Right Sidebar</aside>
</div>
<footer class="bg-gray-100">Footer</footer>
</div>
@jorgeadev
jorgeadev / git-remove-from-staging.md
Last active June 25, 2025 22:02
This quick reference explains how to remove or unstage files in Git — depending on whether you want to keep the file or not

🧠 Git Cheat Sheet: Removing and Unstaging Files

📌 Unstage a File but Keep It

If you've added a file with git add but haven't committed it yet, and you want to remove it from the next commit without deleting it from your working directory, use:

git restore --staged <file>

git restore --staged config.json

To update all outdated pip packages in Windows run:

python -m pip freeze | % { $_.split('==')[0] } | %{ python -m pip install --upgrade $_ }