Glint is a command-line application that allows you to create, edit, and access your own cheat sheet for programming languages, frameworks, or anything else you might want to keep track of. You can add cheats with a name, description, and code snippet, and then easily search for and view them later.
- Clone the repository:
git clone https://github.com/YOUR_USERNAME/glint.git
- Navigate to the project directory:
cd glint
- Install dependencies using Bundler:
bundle install
- Make the bin/glint file executable
chmod +x bin/glint
- For global use - Add glint to your
PATH
export PATH=$PATH:$(pwd)/bin
Before you can use Glint, you need to initialize the database. Luckily glint initializes itself if you run one of the glint commands. For example
bin/glint list
It creates an SQLite database file named glint.db
in the db
directory.
There are two ways to add your own custom cheats
To add a cheat, use the add
command with the cheat's type, name, code snippet and description:
bin/glint add "Create table" "Create a new table in SQL" "CREATE TABLE table_name (
column1 datatype,
column2 datatype,
...
);"
or
Create your own .yml file in the seed/
directory.
Check out existing samples in the directory.
The next time you run a glint
command, your cheats get auto inserted to the database.
To list all cheats, use the list
command:
The type
field can be optionally used to dislay only for a certain type.
bin/glint list <type>
This will display a table of all cheats currently stored in the database.
To search for a cheat, use the search
command with a search term:
bin/glint search "table"
This will display a table of all cheats that include the search term "table" in either the name or description.
To update a cheat, use the update
command with the cheat's ID, new name, and new code snippet:
bin/glint update 1 "Create a new table in SQL" "CREATE TABLE table_name (
column1 datatype,
column2 datatype,
...
);"
This will update the cheat with ID 1 to have the new name and code snippet.
To delete a cheat, use the delete
command with the cheat's name:
bin/glint delete <name>
This will delete the cheat with ID 1 from the database.
- Glint is built using Ruby and SQLite, with the
sqlite3
andterminal-table
gems for database management and table formatting, respectively. - The
bin
directory contains executable scripts for adding, listing, searching, updating, and deleting cheats. These scripts call methods defined inlib/glint.rb
to interact with the database. - The
lib
directory contains the main Glint class and a module for colorizing output. - The database schema is defined in
db/schema.sql
, and the database itself is created and managed usingdb/database.rb
.
This project is licensed under the MIT License.