Skip to content

Instantly share code, notes, and snippets.

View amingilani's full-sized avatar
💯
Always operating at maximum efficiency

Amin Shah Gilani amingilani

💯
Always operating at maximum efficiency
View GitHub Profile
{
"id": "54515454-9ba9-473c-ba7e-dbfb974b44c6",
"revision": 0,
"last_node_id": 1700,
"last_link_id": 2228,
"nodes": [
{
"id": 373,
"type": "ModelSamplingSD3",
"pos": [

This code will flag binary numbers up to 15 using the 4 LEDS connected to pins 10-13.

I wrote (vibe coded) this for my niece as she learns how to program an Arduino.

// We are using 4 LEDs connected to pins 10, 11, 12, and 13
// These 4 LEDs will show numbers in binary (from 0 to 15)

// This is an array.
// An array is a list of values stored under one name.
@amingilani
amingilani / git-functions.sh
Last active October 2, 2024 19:57
Convenient Git and GitHub functions in my .zshrc
# Copy thes to your .zshrc or .bashrc
# Rebase main/master onto my current branch
bup(){
branch="main"
if git show-ref --quiet refs/heads/master; then
branch="master"
fi
@amingilani
amingilani / #django-data-migrations
Last active August 16, 2024 07:13
A helper class I wrote for when I have to run data migrations.
Changing the gist name with this file
@amingilani
amingilani / README.md
Last active January 28, 2024 21:50
Amin's Awesome Gym Schedule

Workout schedules fitting my routine.

@amingilani
amingilani / index.html
Last active June 8, 2022 20:13 — forked from RubaXa/index.html
Array#indexOf vs. Array#includes (http://jsbench.github.io/#0c02e5ebe25ee0374e3736f3289e922a) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Array#indexOf vs. Array#includes</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@amingilani
amingilani / .gitmessage
Last active March 15, 2022 17:01
Git commit template
# Title: Summary, One-sentence headline description of change
# Start upper case, don't end with a period
# 50 chars max. This line is 50 chars long ######
# (Remember blank line between title and body.)
#
# Body: Explain *what* and *why* (not *how*).
#
# Add as many paragraphs as needed
#
@amingilani
amingilani / isolate_palindromes.py
Created June 26, 2021 12:44
Function that takes in a string of words and returns the subset of palindromes
def isolate_palindromes(words: str) -> str:
"""Takes in a string of words and returns the subset of palindromes
Args:
words (str): string of words, e.g. "bar kaak"
Returns:
str: any palindromes within the string of words passed, e.g. "kaak"
"""
@amingilani
amingilani / code.bash
Created January 20, 2021 23:15
Following all the users part of a GitHub organization
# Requires Hub (not the GitHub API) and JQ
ORGANIZATION= # Set this as the organization you want to follow
hub api --paginate /orgs/${ORGANIZATION}/members | jq ".[].login" | (xargs -I % hub api -X PUT /user/following/% && sleep 5)

Vim Cheat Sheet

Navigation

  • End of the file: shift + g
  • Next line: j
  • Go down a defined number of lines: number + j
  • Skip to next word: w