Archive

Posts Tagged ‘github’

Make a GIF of your terminal and insert it in your GitHub README

June 30, 2019 Leave a comment

Problem
For your shiny new GitHub project you want to make an animated GIF and insert it in the README file.

Solution
I found a blog post about it here. In short:

$ ttyrec demo
# do some stuff
Ctrl+D
$ ttygif demo
# the result is in tty.gif

Under Manjaro I could install the packages ttyrec and ttygif with yay.

And then you can insert the GIF in your README.md like this:

![GIF Demo](demo/demo.gif)
Categories: linux Tags: , , , ,

[Nim] A URL shortener command-line app.

October 23, 2018 Leave a comment

This afternoon I wrote a URL shortener command-line application in Nim. It uses the bit.ly URL shortener service.

You can find the project here: https://github.com/jabbalaci/UrlShortener .

Categories: nim Tags: , , ,

Software Carpentry

January 3, 2018 Leave a comment

Software Carpentry is a community of volunteer instructors who teach short workshops and develop lessons which empower researchers of all disciplines to learn about and improve the ways in which they create software and collaborate.” (source)

I found them today: https://github.com/swcarpentry/swcarpentry . Looks good!

funny git commits

February 19, 2017 Leave a comment

Some funny GitHub commits:

Found here.

What to do if shit happened.

Categories: Uncategorized Tags: , , , ,

compile and try a Go project on GitHub

Problem
I found an interesting Go project on GitHub (https://github.com/ichinaski/pxl) that I wanted to try. How to compile it?

(This project “pxl” can display images in the terminal).

Solution

GOBIN=$(pwd) GOPATH=/tmp/gobuild go get github.com/ichinaski/pxl

Under Manjaro I had to install the package “gc”, which contains the official Go compiler.

Categories: bash Tags: , ,

How to update a GitHub forked repository?

Categories: Uncategorized Tags: , , ,

open the github page for the current git repository in your browser

February 4, 2016 Leave a comment

Problem
You have a GitHub project and you are in its local folder in bash. How to open the project’s GitHub page with one command?

Solution
I found a bash function for this (credits are at the top in comments):

# Opens the github page for the current git repository in your browser
# git@github.com:jasonneylon/dotfiles.git
# https://github.com/jasonneylon/dotfiles/
function gh() {
  giturl=$(git config --get remote.origin.url)
  if [ "$giturl" == "" ]
    then
     echo "Not a git repository or no remote.origin.url set"
     exit 1;
  fi

  giturl=${giturl/git\@github\.com\:/https://github.com/}
  giturl=${giturl/\.git/\/tree/}
  branch="$(git symbolic-ref HEAD 2>/dev/null)" ||
  branch="(unnamed branch)"     # detached HEAD
  branch=${branch##refs/heads/}
  giturl=${giturl}${branch}
  echo "#" $giturl
  xdg-open $giturl
}

Just add it to the end of your ~/.bashrc file, open a new terminal (or source it) and use the “command” gh in your shell.

For more info on xdg-open see this post.

Categories: bash Tags: