GithubHelp home page GithubHelp logo

vuppalac / pquote Goto Github PK

View Code? Open in Web Editor NEW

This project forked from th3whit3wolf/pquote

0.0 0.0 0.0 837 KB

Programmer Quotes Library & Binary

Home Page: https://th3whit3wolf.github.io/pquote/pquote/

License: Apache License 2.0

Rust 100.00%

pquote's Introduction

pquote

Programmer Quotes Library & Binary

Continuous Integration Coverage Status Documentation License Rust

List of 323 Quotes from various programmer's

Why

I really liked Vim Startify's programmer quotes every time I used vim. I originally made this to get the same quotes for Dashboard Nvim but I ended up using it for MOTD on remote servers and some other random projects(I love programmer quotes) so I thought I might as well make it a library to make it easier to use.

Why is the binary in the examples directory

The binary is an example because it means all of it's dependencies can be kept seperate from the dependencies of the library, (as far as I can tell there is no way to do this with the lib & main inside src/ or with workspaces) so that if you use this library you're not pulling in 19 other crates you don't need.

How to use

Library

# Cargo.toml

[dependencies]
pquote = { git = "https://github.com/Th3Whit3Wolf/pquote" }
// main.rs or lib.rs

use pquote::QUOTES;

Example

Want to generate a random quote?

use rand::Rng;
use pquote::QUOTES;

fn main() {
    // Get Random Quote
    let x = rand::thread_rng().gen_range(0, QUOTES.len());
    // Print quote and author
    println!("Quote: {}", q.quote);
    println!("\t- {}", q.author);
}

Click here for a much more in-depth example.

Binary

pquote 0.2.0
Programmer Quote Generator

USAGE:
    pquote <FLAGS>

FLAGS:
    -h,--help                Prints help information
    -V,--version             Prints version information
    -v,--verbose             Prints quote verbosely
    -A,--all                 Print all quotes
    -i,--id <id>             Choose quote by id
    -a,--author <author>     Choose quote by author
    -o,--origin <origin>     Choose quote by origin (azquotes,goodreads,journaldev,vimstartify,stormconsultancy)

Prequisites

  • Rust - if not installed run curl https://sh.rustup.rs -sSf | sh

Install

git clone https://github.com/Th3Whit3Wolf/pquote.git
cd pquote
cargo install --example pq

Example Output

    The most fundamental problem in software development is complexity.
    There is only one basic way of dealing with complexity: divide and conquer

    - Bjarne Stroustrup

Credits & Contribution

Vim Startify with it's awesome quotes inspired to make this and I borrowed it's content.

This Programming Quotes API also gave a good amount of quotes.

pquote's People

Contributors

th3whit3wolf avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.