Skip to content

Instantly share code, notes, and snippets.

View ZainRizvi's full-sized avatar

Zain Rizvi ZainRizvi

View GitHub Profile
@ZainRizvi
ZainRizvi / brew_install.sh
Created April 18, 2025 05:24
Brew install list for Macs
# Handy list of apps to install via brew
brew install \
neovim \
git \
tmux \
htop \
python3 \
tree \
fzf \
@ZainRizvi
ZainRizvi / git-prompt-minimal.sh
Last active March 29, 2025 00:06
A minimal, fast prompt to show the git branch status in zsh
# Minimal Git prompt script
# The standard git-prompt.sh script is pretty slow when working
# in large repositories since it runs a bunch of git commands.
# This one strips it down to just a signle git commands that gets the
# current branch.
#
# This works with zsh. Haven't tested it with bash
__git_ps1_minimal() {
@ZainRizvi
ZainRizvi / Lego MindStorm seeorange.py
Created March 2, 2025 18:07
Code to get the Lego MindStorm color sensor to sense the color orange by reading the raw RGB values, converting them to HSL, and detecting the orange range in there. Why the conversion? RBG doesn't have a clear range of pixels that correspond to orange, but HSL does.
from mindstorms import MSHub, Motor, MotorPair, ColorSensor, DistanceSensor, App
from mindstorms.control import wait_for_seconds, wait_until, Timer
from mindstorms.operator import greater_than, greater_than_or_equal_to, less_than, less_than_or_equal_to, equal_to, not_equal_to
import math
# Create your objects here.
hub = MSHub()
color_sensor = ColorSensor('B')
distance = DistanceSensor('D')
motor = Motor('C')
# Change cd to always activate the virtual environment, assuming it's called ".venv"
# Save this in your powershell profile folder (`notepad $PROFILE`) to make it work
function Set-Location {
param(
[Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]
[Alias('PSPath')]
[string]
$Path
)
UseRWithGpus> docker build . -f dockerfiles\tensorflow-2-gpu.Dockerfiles
Sending build context to Docker daemon 2.048kB
Step 1/2 : FROM gcr.io/deeplearning-platform-release/tf2-cpu
latest: Pulling from deeplearning-platform-release/tf2-cpu
35c102085707: Already exists
251f5509d51d: Already exists
928e12577c37: Pull complete
48d9ceba06f1: Pull complete
Digest: sha256:88ae24914e15f2df11a03486668e9051ca85b65f8577358e7d965ce6a146f217
FROM gcr.io/deeplearning-platform-release/tf2-gpu
LABEL maintainer="Zain Rizvi"
@ZainRizvi
ZainRizvi / installr.sh
Created November 27, 2019 20:58
Install R
# Install the lastest version of R from the offical repository
apt install apt-transport-https software-properties-common ocl-icd-opencl-dev -y
apt install dirmngr --install-recommends -y
apt-key adv --keyserver keys.gnupg.net --recv-key 'E19F5F87128899B192B1A2C2AD5F960A256A04AF'
add-apt-repository "deb http://cloud.r-project.org/bin... stretch-cran35/"
apt update
apt install r-base -y
@ZainRizvi
ZainRizvi / nuget.sh
Last active August 29, 2015 14:20 — forked from andypiper/nuget.sh
#!/bin/sh
# add a simple 'nuget' command to Mac OS X under Mono
# get NuGet.exe binary from http://nuget.codeplex.com/releases/view/58939
# get Microsoft.Build.dll from a Windows .NET 4.0 installation
# copy to /usr/local/bin and Robert is your father's brother....
#
PATH=/usr/local/bin:$PATH
mono --runtime=v4.0 /usr/local/bin/NuGet.exe $*