GithubHelp home page GithubHelp logo

lionkor / inspire Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 45 KB

a simple command-line idea collection tool

License: GNU General Public License v2.0

CMake 1.96% C 97.32% Shell 0.72%
unix unix-command ideas

inspire's Introduction

inspire

a simple command-line idea collection tool!

I find myself often lacking ideas for new projects or other things to make, so I made this little command-line tool to remember any ideas i get for later!

How to build

Either run cmake . and then make, or just use gcc: gcc main.c -o inspire

Usage is simple!

  • To add a new idea that you have:

    $ inspire add [idea]
    

    This will read from stdin if you don't supply text, so you can happily pipe into it:

    $ some_other_command | inspire add
    

    Examples:

    $ inspire add asteroids clone but you're the asteroid
    
    $ inspire add
    My new idea
    
  • To retrieve a random stored idea:

    $ inspire give
    

    Example:

    $ inspire give
    asteroids clone but you're the asteroid
    

    (the ability to remove items directly as a reaction to this is WIP)

  • To remove a specific idea from the list:

    inspire remove starts the process of removing an item from the idea list. This process is interactive.

    $ inspire remove
    ideas:
     ID  idea
      0: finish my game
      1: send my friend a gift
      2: take a walk to the forest
      3: idea i dont want
    remove idea (ID) or "-1" to exit: 3
    ideas:
     ID  idea
      0: finish my game
      1: send my friend a gift
      2: take a walk to the forest
    remove idea (ID) or "-1" to exit: -1
    $ 
    
  • To see all stored ideas:

    $ inspire show
    my first idea!
    finish my game
    work on fixme's in 'ideas'
    asteroids clone but you're the asteroid
    

    this can then be piped to less, shuf, for other processing.

  • To clear all ideas, there is currently no builtin way. The best way is to remove the file $HOME/.inspire/data.

inspire's People

Contributors

lionkor avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar

inspire's Issues

Add a way to remove ideas from the list

Currently the workaround is to edit $HOME/.inspire/data, but this should at least be somewhat easier to find. Just printing the path with a command like inspire file would make inspire file | vim possible and solve the issue (somewhat).

An option to "reply" to the output of inspire give to say "please remove this one from the list" would be best.

Ideas in quotes should be stored without quotes

If someone were to add ideas containing tokens used by bash or a similar shell, such as $HOME, they should put the entire idea in quotes. In this case, however, we should ignore the quotes when storing the idea.

Ensure that inspire doesn't read an invalid data file

Currently, the $HOME/.inspire/data file could be replaced by anything, like a symlink to a huge file. This is kind of dangerous, and I don't see why we would load arbitrary files. This could be used to OOM the system, for whatever reason one might do this.

One way to fix this is to choose some random number like 500MB and assume that this is will never OOM the system, then stat the file before we read it to make sure that it's not larger than that (which would be a ridiculous amount of ideas).

Another way to fix this is to add a header to the file head. You could still OOM by appending a large amount of data, but the original problem would be fixed.

Now this problem seems ridiculous and this is an edge case that will never happen, but I feel like this is easy to implement, and its good to make this program as solid as possible.

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.