GithubHelp home page GithubHelp logo

goemoji's Introduction

GoEmoji

I spent some time looking for something really simple: I wanted to be able to do this:

$ echo 'Hello world :tada:' | someprogram
Hello world ๐ŸŽ‰

I didn't find one quickly enough, and as I want to learn go, I thought that doing it myself could be a good task (and it was ๐Ÿ˜„ I learned a ๐Ÿ’ฉ-load of new stuff ๐ŸŽ‰)

To get it working on your machine, just grab the latest .exe from the tags, and add an alias to it or add it in your PATH.

# .bashrc
alias goemoji="path/to/goemoji.exe $*"

Note: the $* at then end allows to give arguments

Now, you can do

$ echo 'I :heart: code' | goemoji
I โค code

You can also build it yourself, it's simple:

$ go build goemoji.go

๐ŸŽ‰

Add a suffix

I'm on Windows, and I'm using Hyper. At this time, Hyper has a bug, emoji take too much room, which "eat" the following char. The solution to prevent this is to add a space just after (so that it eats the space).

Note: this bug has been fixed in the version 1.3.1 of Hyper. But I'll leave this feature, it might be useful for some people.

So, you can specify a suffix by passing it as an argument:

$ git log | goemoji " "

Or by setting it as an environment variable:

$ export GOEMOJI_SUFFIX=" "
$ git log | goemoji

--color=always

Plenty of program add color to their output only if the destination is a terminal. So, when you pipe it, it doesn't use colors (so you get emoji, but no color ๐Ÿ˜ž). It's the case for git log.

Fortunatly, there's often an option to oblige colored output. For git log, it's --color=always

$ git log --color="always" --oneline --graph --decorate -10 --all | goemoji

๐Ÿ˜‰

That's it! Hope you enjoy it (don't forget to โญ this repo if it did ๐Ÿ˜„)

goemoji's People

Contributors

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