CPPTemplate
A template + some tools for getting C++ homework done quick
Install / Use
/learn @Xetera/CPPTemplateREADME
C++ Template
Template + tools for getting C++ homework done quick.
All these scripts utilize unix tools so being on a linux VM is almost required unless you're running cmder or cygwin on Windows which you can get here or here respectively.
How To:
-
git clone https://github.com/Xetera/CPPTemplate.git mycoolhomework -
cd mycoolhomework
That's it, you're good to go!
If necessary, place new .cpp files inside src/ and .h files inside include/ or better yet just use generate.sh to generate them automatically.
Tip:
If you would like a reusable shell file to clone new projects in a folder without each individual folder being a git repo clone you can make
a file called create_project.sh and put it in the root to reuse.
if [[ -z "$1" ]]; then
echo "Must specify a folder name"
exit 1
fi
# cloned git repos are still a copy of the original owner
# and makes it difficult to add to other git repos so
# we just delete the .git folder to make it easier to commit a project folder
git clone https://github.com/Xetera/CPPTemplate.git "$1" && rm -rf "$1/.git"
you can then use bash create_project.sh my_project to make a new folder and delete the git repo
If you wish to use the scripts as executables instead of doing bash run.sh every time you can run the command chmod +x run.sh which will let you do ./run.sh which is a lot more convenient.
generate.sh
Generates new .h/.cpp file combinations in the right folders with the following placeholders.
// src/file.cpp
#include "file.h"
// include/file.h
#pragma once
Usage
- Filename: the name you want to give to the file
bash run.sh [Filename]
run.sh
Runs the latest compiled file and copies the output to a .txt file without using the script command. The file is deleted on each command usage.
Usage
bash run.sh
zip.sh
Compresses relevant files into a tar.gz file for easy submission on canvas.
Zips the following files:
- src/*
- include/*
- Makefile
- *.scr
Usage:
- Filename: the name you want to give to the file (not including the extension) optional; homework.tar.gz by default
bash zip.sh [Filename]
Example:
bash zip.sh hw01
Related Skills
node-connect
337.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
337.7kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.3kCommit, push, and open a PR
