Skip to content

Instantly share code, notes, and snippets.

View shmup's full-sized avatar
🐌

Jared Miller shmup

🐌
View GitHub Profile

Elixir Primer

Core Concepts

  • Functional language built on Erlang VM (BEAM)
  • Immutable data - values never change
  • Pattern matching as primary control flow
  • Process-oriented concurrency (not OS threads)
Import-Module posh-git
Import-Module PSFzf
# Set initial directory
cd "$HOME\workspace\repos\UI"
# Git aliases
Set-Alias -Name g -Value git
Remove-Item alias:gc -Force -ErrorAction SilentlyContinue
function gs { git status $args }

XScreenSaver: Simplified Guide

What Is XScreenSaver?

XScreenSaver is a collection of screen savers for X Window System. Each "module" is a standalone program that renders graphics to a window created by the XScreenSaver daemon.

Basic Approach

  1. Any program can be a screensaver if it can draw on a window it didn't create
  2. You must use C (not C++) because other languages typically can't draw to external windows
  3. XScreenSaver provides utility functions to make development easier
@shmup
shmup / movewindow.ahk
Last active March 12, 2025 19:47
ahk scripts i use at work
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
padding := 20
; half screens
^#h::WinMove, A, , padding, padding, (A_ScreenWidth/2)-(padding*1.5), A_ScreenHeight-(padding*2)
^#j::WinMove, A, , padding, (A_ScreenHeight/2)+padding, A_ScreenWidth-(padding*2), (A_ScreenHeight/2)-(padding*2)
^#k::WinMove, A, , padding, padding, A_ScreenWidth-(padding*2), (A_ScreenHeight/2)-(padding*2)
@shmup
shmup / workspace.ahk
Last active March 10, 2025 15:35
like i3, mod+n goes to the appropriate workspace (if exists)
; AHK v2 script
SetWorkingDir(A_ScriptDir)
; https://github.com/Ciantic/VirtualDesktopAccessor
VDA_PATH := A_ScriptDir . "\VirtualDesktopAccessor.dll"
hVirtualDesktopAccessor := DllCall("LoadLibrary", "Str", VDA_PATH, "Ptr")
GoToDesktopNumberProc := DllCall("GetProcAddress", "Ptr", hVirtualDesktopAccessor, "AStr", "GoToDesktopNumber", "Ptr")
GoToDesktopNumber(num) {
@shmup
shmup / vpet.c
Last active January 21, 2025 18:32
gcc -o vpets vpets.c -lX11 -lXext
#include <X11/Xatom.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/shape.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
int main() {
#!/usr/bin/env python3
from flask import Flask, request, redirect, url_for
from markupsafe import escape
import re
import json
import atexit
from urllib.parse import urlparse
app = Flask(__name__)
@shmup
shmup / compose.yml
Created January 11, 2025 21:08
volume mounts
# simple bind mount - directly maps host directory to container
# pro: simple, direct
# con: less docker-native management
volumes:
- /opt/medusa/postgres:/var/lib/postgresql/data
# named volume with bind properties - docker managed but host-accessible
# pro: docker volume features (named reference, metadata, drivers)
# con: more verbose, possibly overengineered for simple needs
volumes:
@shmup
shmup / owned
Created December 25, 2024 22:09
lol owned
owned