Skip to content

Instantly share code, notes, and snippets.

@ravron
ravron / README.md
Last active May 5, 2025 15:25
Options to prevent accidental Yubikey OTP triggering

Tired of spamming Yubikey one-time password (OTP) codes into Slack? Here are two options to help prevent that. You can do either or both. Both require ykman, the Yubikey CLI configuration manager. Get it with Homebrew:

brew install ykman

If you…

@nuga99
nuga99 / docker-install-parrot.sh
Last active May 5, 2025 15:21
Install Docker Engine on Parrot OS (2023)
#!/bin/sh
# From https://www.hiroom2.com/2017/09/24/parrotsec-3-8-docker-engine-en/
# Changelog:
# @DavoedM: Apr 3, 2020
# @C922A10971734: Jan 19, 2023
set -e
# Install dependencies.
@josejuansanchez
josejuansanchez / universidad_a.sql
Last active May 5, 2025 15:19
Script SQL para crear la base de datos `universidad` (Tipo A) utilizada en los ejercicios de clase. http://josejuansanchez.org/bd/
DROP DATABASE IF EXISTS universidad;
CREATE DATABASE universidad CHARACTER SET utf8mb4;
USE universidad;
CREATE TABLE departamento (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
nombre VARCHAR(50) NOT NULL
);
CREATE TABLE persona (
@mccaffers
mccaffers / git_commit_hash_into_plist_xcode_build_phase.sh
Created May 5, 2025 15:19
This script updates an iOS app's Info.plist file with the current Git commit hash, creating the GitCommitHashApp key if it doesn't already exist. Useful for reference the git hash inside the Swift application.
INFO_PLIST="${TARGET_BUILD_DIR}"/"${INFOPLIST_PATH}"
# Get the GIT hashes
searchOpsApp=$(git rev-parse --short HEAD)
# Query and save the value; suppress any error message, if key not found.
valueApp=$(/usr/libexec/PlistBuddy -c 'print :GitCommitHashApp' "${INFO_PLIST}" 2>/dev/null)
# Check if value is empty
if [ -z "$valueApp" ]
@ShaikhZayan
ShaikhZayan / FASTAPI-OAuth2-System-Integration-With-Next.js.md
Last active May 5, 2025 15:18
How You can use FastAPI with OAuth2 for authentication and integrate it with a Next.js frontend to create a login system.

You can use FastAPI with OAuth2 for authentication and integrate it with a Next.js frontend to create a login system. You can manage your backend logic and authentication in FastAPI and handle the frontend logic, including authorization, in Next.js. Here's a high-level overview of how you can achieve this:

1. Set Up FastAPI with OAuth2

First, you'll need to set up FastAPI with OAuth2 for authentication. Here's a basic example:

FastAPI OAuth2 Setup

  1. Install the necessary dependencies:
@krzys-h
krzys-h / journalctl_to_plymouth.sh
Created January 15, 2021 00:09
Display systemd init messages on the plymouth boot screen
#!/bin/sh
journalctl --quiet -f -n0 --system -t systemd -o cat | while read -r line; do
plymouth display-message --text="$line"
if [ $? -ne 0 ]; then
break
fi
done
echo "Plymouth died, exiting..."
@HimDek
HimDek / Install Windows Subsystem for Android on any Edition of Windows 11 non Insider.md
Last active May 5, 2025 15:14
This Guide will show you how to Install Windows Subsystem for Android or WSA on any Edition of Windows 11 non Insider release.

Install Windows Subsystem for Android on Windows 11 non Insider

WSA or Windows Subsystem for Android is a Tool that allows Windows to run Android Apps directly without using any emulator. The problem is Windows Subsystem for Android is currently only available through preview via the Beta Channel of the Windows Insider Program. But if you follow this guide, you don't have to be in Windows Insider Program to try it out. The only thing you need is Windows 11 installed and some patience.

Prerequisites:

  • A Device with any version and Edition of Windows 11 installed.
  • Internet Connection.
  • Hyper-V enabled.

Enable Hyper-V:

@mjohnsullivan
mjohnsullivan / http_server.rs
Last active May 5, 2025 15:14
Simple HTTP server example for Rust
// Updated example from http://rosettacode.org/wiki/Hello_world/Web_server#Rust
// to work with Rust 1.0 beta
use std::net::{TcpStream, TcpListener};
use std::io::{Read, Write};
use std::thread;
fn handle_read(mut stream: &TcpStream) {
let mut buf = [0u8 ;4096];
@toy-crane
toy-crane / toss-frontend-rules.mdc
Last active May 5, 2025 15:13
토스 프론트엔드 가이드라인 기반으로 만든 Cursor rule
# Frontend Design Guideline
This document summarizes key frontend design principles and rules, showcasing
recommended patterns. Follow these guidelines when writing frontend code.
# Readability
Improving the clarity and ease of understanding code.