Skip to content

Instantly share code, notes, and snippets.

View gbili's full-sized avatar

gbili gbili

View GitHub Profile
@gbili
gbili / PI-Metal-Dectector.md
Created August 13, 2023 17:25
Pulse Induction (PI) metal detector

Creating a Pulse Induction (PI) metal detector is an exciting project that combines electronics and programming. Here's a step-by-step guide to help you build one:

1. Understand the Principle:

Pulse Induction metal detectors work by sending a short pulse of current through a coil of wire. After the pulse ends, the coil "listens" for the echo of the pulse. If there's a metal object nearby, it will induce a current in the object, which will then produce its own magnetic field. When this field collapses, it induces a small current in the coil, which can be detected.

2. Gather the Materials:

  • A coil of wire (for the search coil)
  • An oscillator (to create the pulse)
@gbili
gbili / git-reset-safe.sh
Created February 25, 2024 14:43
Prevent unintended git reset --hard
#!/bin/bash
# alias this script in your shell configuration file (e.g., .bashrc, .zshrc) with something like alias git='./git-reset-safe.sh', but ensure the script is in your PATH or use the full path to the script in the alias.
# Check if the first argument is 'reset' and the second is '--hard'
if [ "$1" = "reset" ] && [ "$2" = "--hard" ]; then
current_dir=$(pwd)
echo "🚨 About to nuke changes in: $current_dir"
echo "Paste the directory path to prove you're serious (no take-backs!):"
read user_input
@gbili
gbili / lbop.md
Last active August 22, 2024 18:34
The little book of Python

Sure, let's work on a compact guide called The Little Book of Python, modeled after The Little Book of Deep Learning. The goal will be to provide a concise, yet comprehensive overview of Python, from basics to advanced topics, making it accessible but still dense with useful information. Here’s an outline to start with:


The Little Book of Python

Chapter 1: Why Python?

Python is a high-level, interpreted language known for its simplicity and readability. It’s favored in multiple domains like web development, data science, machine learning, automation, and more. Why Python?

  1. Easy to learn – Its syntax is straightforward, mimicking natural language.