Skip to content

Instantly share code, notes, and snippets.

View mjbalcueva's full-sized avatar

Mark John Balcueva mjbalcueva

View GitHub Profile
@mjbalcueva
mjbalcueva / wifi-password-retriever.md
Last active February 28, 2025 15:34
Wifi Password Retriever

WiFi Password Retriever Script

A simple one-line script that retrieves all stored WiFi network names and their passwords from a Windows system.

Usage

Command Prompt Version

for /f "tokens=2 delims=:" %i in ('netsh wlan show profiles^|findstr "All User Profile"') do @for /f "tokens=* delims= " %j in ("%i") do @(echo. & echo %j & for /f "tokens=2 delims=:" %k in ('netsh wlan show profile name^="%j" key^=clear^|findstr /C:"Key Content"') do @for /f "tokens=* delims= " %l in ("%k") do @echo %l)
@mjbalcueva
mjbalcueva / Server-Side Conditional Rendering.md
Last active September 20, 2024 08:09
Server-Side Device-Based Conditional Rendering in Next.js

Server-Side Device-Based Conditional Rendering in Next.js

Problem

You want to conditionally render components on the server side based on the device type (mobile, tablet, desktop). The goal is to avoid rendering all components server-side and hiding them with CSS, and to prevent client-side JavaScript from causing a flash of content as it loads.

Solution

Create a hook that determines the device type based on window size and stores it in a cookie. Use this context to conditionally render components according to the device type.

@mjbalcueva
mjbalcueva / password-input.tsx
Last active February 26, 2025 06:55
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) => {
@mjbalcueva
mjbalcueva / BinarySearchTree.java
Last active October 14, 2023 13:09
A collection of programming challenges
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class BinarySearchTree {
Scanner console = new Scanner(System.in);
Node root;
public static void main(String[] args) throws Exception {
BinarySearchTree program = new BinarySearchTree();
@mjbalcueva
mjbalcueva / OmekaClassic.md
Created August 27, 2023 18:57
Omeka Classic Installation Guide for Debian Based Distros

Omeka Classic Installation Guide (Ubuntu 22.04.3)

Installation Prerequisites

  1. Download virtualbox
  2. Download ubuntu

Virtual Machine (Ubuntu) Setup

  1. Launch VirtualBox and create a new virtual machine instance using the downloaded Ubuntu ISO.
# Get editor completions based on the config schema
"$schema" = 'https://starship.rs/config-schema.json'
# ---------------------------------------------------------------------------------------------------------------------
format = """
[](#9A348E)\
$os\
$hostname\
[](bg:#DA627D fg:#9A348E)\
@mjbalcueva
mjbalcueva / calendar.tsx
Last active February 26, 2025 19:17
shadcn ui calendar custom year and month dropdown
"use client"
import * as React from "react"
import { buttonVariants } from "@/components/ui/button"
import { ScrollArea } from "@/components/ui/scroll-area"
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"
import { cn } from "@/lib/utils"
import { ChevronLeft, ChevronRight } from "lucide-react"
import { DayPicker, DropdownProps } from "react-day-picker"
@mjbalcueva
mjbalcueva / ohmyposhv3-v2.json
Last active August 19, 2022 23:31
Terminal Config
{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,