Skip to content

Latest commit

 

History

History
74 lines (49 loc) · 4.22 KB

README.md

File metadata and controls

74 lines (49 loc) · 4.22 KB

code-now

A chrome/chromium plugin for CodeChef, SPOJ, CodeForces and HackerEarth to instantly open your Favorite IDE

What it does !!

It is a simple chrome/chromium plugin for Linux Users which adds 4 buttons to every CodeChef / SPOJ / CodeForces / HackerEarth Problem Page (one for each of C, C++, Python and Java). Clicking on each button will open up your favorite IDE for that language instantly with a default template !! It is particularly useful during short contests.

You can choose different IDEs for different Languages. Templates can also be different for different Languages.

Prerequisites

Any Linux Distro / MAC OS X, Google Chrome Browser, Python 2.7 or above and Your favorite IDEs

Google Chrome can be installed from here : https://www.google.com/chrome/browser/ Chromium Browser can be installed via Ubuntu Software or by typing following command :

sudo apt-get install chromium-browser

Installation

Easy 2-step Installation. Download the latest release here -> Release v5.0 and unzip it

  1. Install Plugin - The chrome plugin is available for free installation on Chrome Web Store. Install it here

  2. Install Host Program - A simple script has been provided for installation of the host script on your machine which can communicate with the chrome plugin. Before installing, please edit the template files provided. These templates will be automatically added to all your solutions. After editing Templates you can first set the executable bit of the install.sh script and then execute it.

cd PATH_TO_INSTALL_FOLDER
chmod +x install.sh
./install.sh

You can configure your default IDEs for each of the 4 languages during installation. In case you need to re-configure your templates or IDEs please reinstall the host program by runnning the installation script again.

Development

This a small app. Most code is self explainatory. Three primary languages - js, shell-scripting and python. You might use IDE if you want. The flow of the system is :

  1. The manifest file specifies which JS script runs on which page
  2. JS script extracts the problem information and adds the button. Click listenors sends the data to native host.
  3. Native host is a python script on local system. It reads the data and makes a new file, add appropriate header and then starts a the IDE on a separate thread.
  4. Shell Script is useful to install the system. It checks for dependencies and configures the values used in python script.

Note : basic.js file runs on all problem pages. It declares the languages supported and initialises some variables used by all other scripts. JQuery is a dependency for all scripts.

If you want to contribute / work with the code you have to check the "developer mode" on the top right corner of the chrome's extension page(chrome://extensions). After that use the chrome's Load Unpacked Extension feature for working with javascripts. Note that while using this method only the javascript will run but the native messaging will actually not work due to the a different extension ID. You have to pack the extension using the Pack Extension feature in developer mode and then install the packed extension for Native Host to work. The Private Key to pack the extension is included in the repository. To avoid packing extension everytime you make changes to plugin you can load the unpacked extension and then change the codenow.json file with the extension id generated by chrome when you load the unpacked extension and then install the host program using install.sh file.

"allowed_origins": [
    "chrome-extension://eiifebdnfcadjhgenpanagdankjhkjeb/"
  ]

Refer the todo.md file for a list of features that you can add to this application

Contributors

Following is a list of contributors:

  1. Ashish Kedia (@ashish1294)
  2. Dementor (@sam17)
  3. Sahil Dua (@sahildua2305)
  4. Ibrahim Jarif (@jarifibrahim)