Skip to content

Instantly share code, notes, and snippets.

View shawnhank's full-sized avatar

Shawn Hank shawnhank

View GitHub Profile

Guide on How to Build a Browser Game

Intro

Getting started and knowing how to structure the code in an application is one of the most difficult things for students to figure out.

Also, there might be plenty of sources available to learn about how to use a forEach loop, but finding help on how to think like a developer and write code to implement an app's features is difficult at best.

Let's Code Connect-Four!

Intro

So far, we've covered the fundamentals of:

  • HTML
  • CSS
@shawnhank
shawnhank / git-aliases.md
Created April 19, 2025 06:26 — forked from mwhite/git-aliases.md
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@shawnhank
shawnhank / pull-upstream.md
Created April 19, 2025 06:24 — forked from jim-clark/pull-upstream.md
Obtain Updates to Class Repos (Course, Lectures & Assignments)
# Clone the repo
git clone https://github.com/imartinez/privateGPT
cd privateGPT
# Install Python 3.11
pyenv install 3.11
pyenv local 3.11
# Install dependencies
poetry install --with ui,local
@shawnhank
shawnhank / main.py
Created January 23, 2024 22:01 — forked from mberman84/main.py
OpenChat Code
import requests
import json
import gradio as gr
url = "http://localhost:11434/api/generate"
headers = {
'Content-Type': 'application/json',
}
@shawnhank
shawnhank / templogger.sh
Created December 8, 2023 07:24 — forked from i3luefire/templogger.sh
This is a variation of fkleon's temperature.sh script that puts the info in a simple text file instead of an email. It is also my first gist on github. :)
#! /bin/sh
# This is your log filename
LOGFILE=/path/to/temp.log
# Create empty file
touch $LOGFILE
# Define adastat function, which writes drive activity to temp file
adastat () {
@shawnhank
shawnhank / 01-pihole.conf
Created October 25, 2023 17:34 — forked from mtrimarchi/01-pihole.conf
pi.hole dnsmasq conf
# /etc/dnsmasq.d/01-pihole.conf
# Pi-hole: A black hole for Internet advertisements
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
#
# Dnsmasq config for Pi-hole's FTLDNS
#
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
@shawnhank
shawnhank / homelab.markdown
Created September 17, 2023 06:12
Personal Notes on Home Lab Administration

Personal Notes on Home Lab Administration

This is a collection of personal notes on self-hosted home lab administration. This reference assumes the underlying OS is Ubuntu Server 22.04.

Installing a New Hard Drive

List block devices and get UUIDs for the partitions

It is recommended to use lsblk command to get information about block devices rather than blkid. lsblk provides more information, better control on output formatting and it does not require root permission to get actual information.

@shawnhank
shawnhank / PVE-host-backup.md
Created April 26, 2023 23:35 — forked from mrpeardotnet/PVE-host-backup.md
Proxmox PVE Host Config Backup Script

Proxmox PVE Host Config Backup Script

This script can be used to backup essential configuration files from the Proxmox Virtual Enivronment (PVE) host.

The script will create backups using tar with specified backup prefix and date and time stamp in the file name. Script will also delete backups that are older then number of days specified.

Create backup script file

To create backup script that will be executed every day we can create backup script in /etc/cron.daily/ folder. We need to make it writeable by root (creator) only, but readable and executable by everyone:

touch /etc/cron.daily/pvehost-backup