Giter Club home page Giter Club logo

borg's Introduction

BORG - Search and save shell snippets without leaving your terminal

cruft guaranteed Travis CI Go Report Card Slack Status

Borg was built out of the frustration of having to leave the terminal to search and click around for bash snippets. Borg's succint output also makes it easy to glance over multiple snippets quickly.

Search

borg "list only files"
(1) Bash: How to list only files?
        [a] find . -maxdepth 1 -type f
        [b] ls -l | egrep -v '^d'
            ls -l | grep -v '^d'

(2) List only common parent directories for files
        [a] # read a line into the variable "prefix", split at slashes
            IFS=/ read -a prefix
            # while there are more lines, one after another read them into "next",
            # also split at slashes
            while IFS=/ read -a next; do
                new_prefix=()
                # for all indexes in prefix
                for ((i=0; i < "${#prefix[@]}"; ++i)); do
                    # if the word in the new line matches the old one
                    if [[ "${prefix[i]}" == "${next[i]}" ]]; then
        ...

Use borg pipeto less to pipe the results straight to less, or any other program of your choosing.

Can't find what you are looking for? Be a good hacker and contribute your wisdom to the hive mind - add your own snippets or tweak the existing ones.

Install

The following releases only let you search, to use add/edit install from source, releases are coming soon.

brew install borg

For linux, download a release manually releases

wget https://github.com/ok-borg/borg/releases/download/v0.0.1/borg_linux_amd64 -O /usr/local/bin/borg
chmod 755 /usr/local/bin/borg

Or download a release manually for Mac:

wget https://github.com/ok-borg/borg/releases/download/v0.0.1/borg_darwin_amd64 -O /usr/local/bin/borg
chmod 755 /usr/local/bin/borg

Rate results: worked

When you see a result that worked for you, you can use the worked command to give feedback:

borg worked 12

Once you do this the result will rank higher for similar queries - it is especially useful if you find a good result that you think are too down in the result list.

Advanced usage

For more commands and their explanations, please see advanced usage

How does borg work?

The client connects to a server at ok-b.org, but you can host your own if you want to (see daemon folder).

Self hosting will become less appealing once people start contributing their own content to the database though.

Explanation for ui

  • () denotes hits for your query
  • [] denotes snippets found for a given query
  • ... under a [] means more lines to display (use the -f flag for full display, see more about usage below)

Credits

The borg mascot has been delivered to you by the amazing Fabricio Rosa Marques.

Community:

Running with docker

You can use the dockerized borg client if you don't want to install anything on your host!

Outages

  • We've had a multi day outage on Jan 18 - Jan 28. It ruined our uptime stats for the next couple of thousand years.

borg's People

Contributors

anas10 avatar crufter avatar fabric-8 avatar gummiboll avatar jeremyletang avatar juhofriman avatar klausvii avatar zchee avatar

Watchers

 avatar  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.