Giter VIP home page Giter VIP logo

gpi-url-shortener's Introduction

gpi-url-shortener

A demo of how github can be made into a url shortener

Made for CMU GPI to help students learn git.

Getting started using your own url shortener

  1. Fork this repo
  2. Clone your forked repo. If you have ssh setup:
git clone [email protected]:[your github username]/gpi-url-shortener.git

Everyone else:

git clone https://github.com/[your github username]/gpi-url-shortener.git
  1. Rename the example_github_config.py to github_config.py, add your github username or custom github url in the file, and put the absolute path to your repo. Remember that when inside the repo pwd can give you the current directory's absolute path.
  2. Make sure that you have ssh keys setup for your github. If you are not sure how to do this, you can follow this tutorial.
  3. Add to your .bashrc, .bash_profle, .zshrc, etc. the following:
shortenurl(){
  current_dir=$(pwd)
  cd /Users/ejeppinger/Documents/CMU/ta-gpi/gpi-url-shortener/
  python3 url_shortener.py
  cd $current_dir
}

Don't forget to re-source your rc file!!

  1. In the repository settings turn on ghpages from the master branch
  2. You're all set!! Simply from terminal run:
shortenurl

And you should be walked through the process of shortening a url.

You should see something like this:

what url do you want to shorten?
url to be shortened: http(s)://thebomb.com.net.gov
shorten to https://[your github id].github.io/gpi-url-shortener/this_is_super_short
doing some stuff....
url has been shortened to: https://[your github id].github.io/gpi-url-shortener/this_is_super_short/
it might take ~5 mins for the link to become active
  1. If you have a custom domain you want to use with your url shortener, you can set it up for the github repo by following the instructions here.

Have fun and let us know if you have any questions on piazza!!!

Don't forget to hit the quan and yell YEAAAAAHHHH DONNER ๐Ÿ‘Œ ๐Ÿ‘Œ ๐Ÿ‘Œ ๐Ÿ‘Œ

gpi-url-shortener's People

Contributors

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