Giter VIP home page Giter VIP logo

cutcode's Introduction

cutcode

Chrome and Firefox extension to copy code snippet from Stack Overflow by double clicking.

Screencast

Getting Started

Installing

Available on the Firefox Add-ons site.

  • Clone the repo.

    git clone https://github.com/amitness/cutcode

    Installing on Chrome

  • Load the extension into Google Chrome as an Unpacked Extension:

    • Navigate to (1a) chrome://extensions or (1b) select Menu > More Tools > Extensions.

    • Enable the (2) developer mode at top right.

    • Click (3) "Load Unpacked Extension".

    • Navigate to the cloned folder.
      For additional help, refer the official guide for Chrome.

      Installation screenshot

    Installing on Firefox

  • Load the extension into Firefox as a Temporary Add-on:

    • Open Firefox
    • Enter (1) "about:debugging" in the URL bar
    • Click (2) "Load Temporary Add-on"
    • Open the cloned directory and select any file inside the folder.
      For additional help, refer the official guide for Firefox.

    Installation screenshot

Local Development

  • Follow installation instructions and install the extension.
  • Work on the code.
  • Use Reload (Ctrl+R) to reload the extension from chrome://extensions page.
  • Test the new changes.

Contributing

We ❤️ contributions. Feel free to send us a PR.

  1. Create an issue if there is one.
  2. Fork the repo.
  3. Create your feature branch (git checkout -b your-feature).
  4. Add and commit your changes (git commit -am 'message').
  5. Push the branch (git push origin your-feature).
  6. Create a new Pull Request.

Feedback

Create an issue for all discussions, bugs, feature requests and pull requests.

License

This project is licensed under the GNU License - see the LICENSE file for details.

Icon provided by Open Iconic.

References

cutcode's People

Contributors

adamki avatar amitness avatar andrewmbyrd avatar kitlawes avatar miguelgrc avatar willbiddy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cutcode's Issues

Automatically remove >>> from code

In Stackoverflow, some code snippets have a preceeding >>> to show that it's running on interpreter or shell.

For example:

>>> names = ['King', 'Queen', 'Joker']
>>> any(n in 'King and john' for n in names)
True

A feature to remove those symbols from the code when it's copied to clipboard will be useful.

Expand to code in GitHub readme files

I don't know if you want to expand this to other websites, but it's easy to make this work for readme files on GitHub. I'll add a pull request for this and you can add it if you want.

Automatic attribution for copied code

See if it's possible to implement a feature such that:

  • Code copied from Stackoverflow has a automatic attribution similar to:
    /*  
    Reference: https://www.stackoverflow.com/...
    */
  • This setting should be turned off by default and can be enabled from the settings page of extension.

Issues:

  • Comment style depends on the programming language
  • How to determine the programming language of the copied code?
  • Does the implementation bring added complexity to the extension?

Extension works in Firefox

I've tested the extension in Firefox and it works without changing any of the code! I think we should start editing the readme to say that it works in Firefox and add some instructions about how to install it there.

User binded hotkey + click

The double click feature works well, however some people (including myself) use double click to quickly highlight just a method, or triple click for the line.

Having a user defined hotkey + left click to trigger the copy would go a long way for UX.

I've tried to implement this myself, however I ran into issues capturing the ascii characters for non alphanumeric keys. This feature would take place primarily in settings.js/usersettings.html and would need special attention to sanitizing input.

alternatively, we can create a dropdown box with control, alt, or shift as an input and left click as default. This would allow us to widen the options and would make capturing the ascii input a moot point.

Cutcode history table in settings

The last 'n' cutcode copy pastes in a table with a date. Updates date value if the same code is added, otherwise new line. Once max count is reached, drop the oldest.

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.