Skip to content

Instantly share code, notes, and snippets.

View coopermayne's full-sized avatar

Cooper Mayne coopermayne

View GitHub Profile
@coopermayne
coopermayne / solution_to_pbm.py
Created January 28, 2026 03:11
Two Not Touch - Solution JSON to PBM (with stars)
#!/usr/bin/env python3
"""
Converts Two Not Touch puzzle JSON to PBM image with stars from solution.
Usage:
python3 solution_to_pbm.py puzzle.json # outputs puzzle_solution.pbm
python3 solution_to_pbm.py puzzle.json -o output.pbm # custom output path
python3 solution_to_pbm.py < puzzle.json > output.pbm # stdin/stdout
cat puzzle.json | python3 solution_to_pbm.py # pipe
"""
@coopermayne
coopermayne / puzzle_to_pbm.py
Created January 28, 2026 03:11
Two Not Touch - Puzzle JSON to PBM (no stars)
#!/usr/bin/env python3
"""
Converts Two Not Touch puzzle JSON to PBM image (puzzle only, no stars).
Usage:
python3 puzzle_to_pbm.py puzzle.json # outputs puzzle.pbm
python3 puzzle_to_pbm.py puzzle.json -o output.pbm # custom output path
python3 puzzle_to_pbm.py < puzzle.json > output.pbm # stdin/stdout
cat puzzle.json | python3 puzzle_to_pbm.py # pipe
"""
@coopermayne
coopermayne / puzzle_schema.json
Created January 28, 2026 03:00
Two Not Touch Puzzle JSON Schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://example.com/two-not-touch-puzzle.schema.json",
"title": "Two Not Touch Puzzle",
"description": "A Two Not Touch puzzle with solution and solving steps",
"type": "object",
"required": ["puzzle", "solution", "steps"],
"additionalProperties": false,
"properties": {
"puzzle": {
@coopermayne
coopermayne / generate_puzzle_json.py
Created January 28, 2026 03:00
Two Not Touch Puzzle Generator - JSON Output
#!/usr/bin/env python3
"""
Two Not Touch Puzzle Generator - JSON Output
Generates a puzzle and outputs JSON with: puzzle, solution, steps
Usage:
python generate_puzzle_json.py # Output to stdout
python generate_puzzle_json.py > puzzle.json # Save to file
"""
# =============================================================================
# PORTABLE ZSHRC - Works on macOS and Linux
# =============================================================================
# DEPENDENCIES TO INSTALL:
# - fzf : Fuzzy finder [macOS: brew | Linux: apt]
# - lazygit : Git TUI [macOS: brew | Linux: brew or GitHub releases]
# - lazydocker : Docker TUI [macOS: brew | Linux: brew or GitHub releases]
# - btop : System monitor [macOS: brew | Linux: apt]
# - zoxide : Smarter cd [macOS: brew | Linux: apt]
# - glow : Markdown viewer [macOS: brew | Linux: apt or snap]
@coopermayne
coopermayne / vid-background-trick.css
Created December 13, 2016 22:28
CSS trick for getting a well centered video background to a div
.video_contain {
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
}
video {
position: absolute;
@coopermayne
coopermayne / javascript
Last active October 22, 2015 13:46
javascript ref
#JAVASCRIPT NOTES
This is for you to reference when doing homework --- this will contain it all!
**Table of Contents**
[TOC]
###data types
```
// variables (user 'var')
@coopermayne
coopermayne / todaynotes
Last active August 29, 2015 14:25
your work from today
###Guessing game
```ruby
puts"pick an integer number 1...100 and keep it in your head"
puts "NO TROLLOLLOLLOLLOLLOLLOLLOing"
puts "continue... ( press enter)"
gets
top = 1000
bottom = 0
@coopermayne
coopermayne / homework
Last active August 29, 2015 14:25
homework
#EXERCISES
##while while while
first let's do some stuff with while loops and counters
####one
make a while loop that runs 3 times -- printing some text each time -- then stops running. (you'll need to use a counter)
####two
@coopermayne
coopermayne / gta
Created July 21, 2015 16:39
GTA Game Plan
# GTA Gameplan
## Version 1
- **map:** one dimensional, strings
- **items:** strings
- **user:** the user has an inventory and a current location. the inventory is an array of items. the location is a simple string.
- **actions:** the user has some basic actions... for instance:
- **take:** take an item from the world and move it to user's inventory
- **move:** move to a different location on the map
- **status:** prints out users inventory and current location