Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# ==============================================================================
# Cursor IDE Management Script for macOS
# ==============================================================================
# --- Configuration ---
BACKUP_BASE_DIR="${HOME}/code/CursorBackups"
LOG_FILE="${BACKUP_BASE_DIR}/cursor_manager.log"
APP_PATH="/Applications/Cursor.app"

MLE Interview Prep Notes

Use spaced-repetition; revise at the end of:

  • day
  • week
  • month
  • 6 months
  • 1 year

1. What is bias-variance tradeoff? How to detect? How to remediate?

@gaviral
gaviral / ollama_bot.py
Created October 22, 2024 21:09
Ollama Terminal App
# Step 1: Ensure Ollama is installed and running on your machine.
# You can install Ollama by running the following command in your terminal for Linux:
# curl -fsSL https://ollama.com/install.sh | sh
# For other operating systems, visit https://ollama.com to download and install.
# Step 2: After installation, pull the model of your choice.
# For example, to pull the llama3.1 model, use:
# ollama pull llama3.1
# Make sure your machine meets the system requirements for running models. For example, 8GB of RAM for smaller models like llama3.1.
@gaviral
gaviral / auto_refresh_random_interval.js
Created May 15, 2024 00:01
Page Auto-Refresh with Random Interval (for CJS-2 chrome extension and not using other extensions that ask permissions to read all your data)
var minRefreshIntervalInSeconds = 5;
var maxRefreshIntervalInSeconds = 10;
var seed = Date.now();
Math.seed = seed;
function seededRandom() {
var x = Math.sin(Math.seed++) * 10000;
return x - Math.floor(x);
}
@gaviral
gaviral / install-tmux.sh
Last active March 2, 2021 19:41 — forked from muralisc/install-tmux.sh
Install tmux 3.0a on Amazon Linux 2 / rhel /centos
# Install tmux 3.1c on Amazon Linux 2
# install deps
sudo yum install -y gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -LOk https://github.com/libevent/libevent/releases/download/release-2.1.11-stable/libevent-2.1.11-stable.tar.gz
tar -xf libevent-2.1.11-stable.tar.gz
cd libevent-2.1.11-stable
./configure --prefix=/usr/local
##########################################################
# CODE INSTRUCTIONS: #
# 1) The method findLargestSmallerKey you're asked #
# to implement is located at line 30. #
# 2) Use the helper code below to implement it. #
# 3) In a nutshell, the helper code allows you to #
# to build a Binary Search Tree. #
# 4) Jump to line 71 to see an example for how the #
# helper code is used to test findLargestSmallerKey. #
##########################################################
import os
def main():
fName = [' ']
fName.append("1 Trees___redacted__")
fName.append("2 Trees___redacted__")
fName.append("3 Trees___redacted__")
fName.append("4 Trees___redacted__")
fName.append("5 Trees___redacted__")
@gaviral
gaviral / favouriteMovies.js
Created April 20, 2019 01:54
Automatically find and render movie trailers for a list my favorite movies.
var player;
var selectedMovieName;
console.log("branch test for CI");
// Pause the video when the modal is closed
$(document).on('click', '.hanging-close, .modal-backdrop, .modal', function(event) {
// Remove the src so the player itself gets removed, as this is the only
// reliable way to ensure the video stops playing in IE
stopVideo();
var iFrame = document.getElementById('trailer-video-container');
var trailerDiv = document.createElement("div");