Skip to content

Instantly share code, notes, and snippets.

@gamesguru
gamesguru / slapstreams.io-injection-script.css
Last active January 22, 2026 00:06
Customize slapstreams to prioritize the video player
/* 1. LAYOUT: Unlock full width for the page */
.container {
max-width: 100% !important;
width: 98% !important;
padding-left: 0 !important;
padding-right: 0 !important;
}
/* 2. LAYOUT: Hide the Sidebar */
.col-md-4.wp-bp-sidebar-width {
@gamesguru
gamesguru / python-user-patch.md
Created January 13, 2026 04:34
Install Python at user level in recent version of macOS and Linux

The trick

mkdir -p ~/.config/pip
vim ~/.config/pip/pip.conf

(Precise location may vary depending on operating system.)

Add the following lines:

@gamesguru
gamesguru / .bashrc
Last active January 10, 2026 23:19
[bug-fix] .bashrc snippet allowing Antigravity/gemini-cli to see standard output
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
if [[ -n "$ANTIGRAVITY_AGENT" ]]; then
export PS1='$ '
unset HISTFILE
unset PROMPT_COMMAND
if [ -z "$ANTIGRAVITY_RECURSION" ]; then
# avoids a loop-crash, in case your ~/.profile calls ~/.bashrc
@gamesguru
gamesguru / rateMyProfessorsDeptAvg.js
Last active May 26, 2025 15:57
Script to load all professors and calculate a department's weighted average for ratings and difficulties.
/** SCORES (RESULTS)
Average rating at Oakland University: 3.12
Average difficulty at Oakland University: 3.56
Based on 123 professors and 4636 ratings in the Mathematics department.
https://www.ratemyprofessors.com/search/professors/716?q=*&did=38
Average rating at Oakland Community College: 3.44
Average difficulty at Oakland Community College: 3.35
Based on 14 professors and 132 ratings in the Mathematics department.
https://www.ratemyprofessors.com/search/professors/11931?q=*&did=38
@gamesguru
gamesguru / khaled-amazon-reading-book-chapters.cpp
Last active December 29, 2025 14:04
Solution to reading a book of chapters within given number of days
#include <bits/stdc++.h>
using namespace std;
int solution(vector<int> arr, int days_til_exam) {
// number of chapters
int n_chaps = arr.size();
// longest chapter
int m = *max_element(arr.begin(), arr.end());
@gamesguru
gamesguru / .screenrc
Created March 17, 2022 18:15
From Chris
defshell -bash
hardstatus alwayslastline
hardstatus string '%{= kw}%-w%{= BW}%50>%n %t%{= kw}%+w%<'
shelltitle ""
multiuser off
vbell_msg "Beep!"
startup_message off
defscrollback 40000
#terminfo and termcap for nice 256 color terminal
# allow bold colors - necessary for some reason
@gamesguru
gamesguru / .bash_profile
Created March 5, 2021 19:53
bash profile (macOS)
[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"
[[ -r "/usr/local/etc/bash_completion.d/python-argcomplete" ]] && . "/usr/local/etc/bash_completion.d/python-argcomplete"
_ssh()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts=$(grep '^Host' ~/.ssh/config ~/.ssh/config.d/* 2>/dev/null | grep -v '[?*]' | cut -d ' ' -f 2-)
@gamesguru
gamesguru / sol.py
Created January 15, 2021 18:19
Python printing: family-tree
class Node:
def __init__(self, parent_id, id, name):
self.id = id
self.parent_id = parent_id
self.name = name
self.children = []
def printChildren(node, level=1):
for c in node.children:
.headers on
.mode column
PRAGMA foreign_keys = 1;
@gamesguru
gamesguru / cpu_info.py
Created September 8, 2020 17:53
Gets CPU/MoBo/HDD info on Linux
#!/usr/bin/env python3.7
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 11 13:55:12 2018
@author: shane
"""
import os, sys
import subprocess