Coder Social home page Coder Social logo

luisfontes19 / vscode-swissknife Goto Github PK

View Code? Open in Web Editor NEW
48.0 3.0 7.0 14.59 MB

Scriptable VSCode extension to generate or manipulate data. Stop pasting sensitive data in webpages.

Home Page: https://marketplace.visualstudio.com/items?itemName=luisfontes19.vscode-swissknife

License: MIT License

TypeScript 95.02% HTML 4.57% JavaScript 0.41%
swissknife vscode plugin

vscode-swissknife's Introduction

Swissknife

Available in the Visual Studio Marketplace

Swissknife is the developers' toolbox. It provides a set of features (we call them scripts) to convert data in the editor, like converting to hex, base64 or to generate new data like current timestamps or random strings, etc.

Main Features

  • Multiple generators and converters available in the form of scripts
  • Extensible with custom scripts
  • Local webserver with request logging
  • File Explorer decorators (and custom decorators)
  • Generate pretty, framed screenshots of the code
  • Right click on a line to copy file relative path with line number ("Copy file path with line")
  • Notes/Comments per file line and reporting

Demo

Some of the available scripts

Base64 decode Base64 encode Binary To Text
Bip39 Mnemonic Capitalize Count characters
Count words CSV to Markdown Date to Timestamp
Generate Password Hex decode Hex encode
Hex to RGB HTML Encode (ALL) Identify hash
Join lines JSON to YAML JWT Decode
Local DateTime Lorem Ipsum Markdown to HTML
Md5 hash New Swissknife Script (JS) New Swissknife Script (TS)
Password strength Pick random line Quoted Printable Decode
Random String Request to fetch RGB(a) To Hex
RSA Key pair Self Signed Certificate SHA1 hash
SHA256 hash SHA512 hash Sort Lines
Start Local HTTP Server Start Local HTTPS Server Stop HTTP Server
Text To Binary Text to String (Escape) Timestamp to Date
To Camel Case To Lower Case To Morse code
To Upper Case Unicode decode Unicode encode (js format)
Unix/Linux Permission To Human Readable Url Decode Url Encode
Url Encode (All Characters) Url Shorten Url Unshorten (url expand)
UTC DateTime UUIDv4 YAML to JSON

Usage

You can invoke the dedicated command pallete with ctrl+shift+9 for windows or cmd+shift+9 for mac (when focusing the editor)

The conversions will only use the selected text by default. If no text is selected the entire content of the editor will be used. It supports multi selection and will run the script for each selection individually

Notes

You can now add notes per line to your code. Since this feature changes a bit the gutter and you start to see a plus sign on the left of the line numbers on the line you hover the mouse, we ship this feature disabled by default and can be enabled per workspace.

Banner

Use the command Swissknife: Enable Notes for workspace to enable it for the current workspace. From there on you can start adding notes to your code to specific lines as shown in the gif above.

You can also generate a report of all notes in the project by using the command Swissknife: Generate Notes Report.

To view the existing notes you'll see a new tab in the bottom pannel called Comments where you can find the all the notes created for the workspace

File Explorer Decorators

You can use decorators to identify files in the explorer. You can create custom decorators and guess what... Emojis are allowed 😁. You can copy them from here.

Due to a limitation in vscode extension system AFAIK I can't allow users to extend the menu with their own decorators, so you always need to go through the "Custom" option to use other decorators.

In the explorer section you'll also have a new section to view all the files decorated with this extension

Decorators

Code Screenshot

Just select the code you want to create a screenshot from (or don't select anything and the entire code will be used) and search for the Code Screenshot screen.

The filename in the screenshot window is taken from the current file name, and if the file is not saved a temporary name will be used. The file name is editable, so when the right panel appears you can change the name, if you want :)

code screenshot

Identify Hash

The outcome of the operation may return multiple values, as a hashes from different algorithms have the same output format. Still we organize the hashes from top down by most relevant.

HTTP(S) Server

The servers log all requests received into the "Output" window of VSCode (You can show it by going to view -> Output in the menu). Then on the right of the window (where usually has the value "Tasks"), filter by "Swissknife Server"

Writing Scripts

You can quite easily create your own scripts, without the need to dig through the code of the extension. Just create a file and drop it in the "Scripts" folder.

Check how to do it here

Future Plans

  • Create unit tests, specially for the scripts
  • Start doing proper error handlings
  • Create a place for user contributed scripts

vscode-swissknife's People

Contributors

chatelao avatar luisfontes19 avatar zlitus 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

Watchers

 avatar  avatar  avatar

vscode-swissknife's Issues

Undo behavior

Hello,

I use Swissknife a lot to convert timestamps to dates and dates to timestamps, it is great; especially great with multiple cursor πŸ‘.

However, if I select 50 different timestamp on 50 different cursors and convert them to dates, then I see than I made a mistake on my selection and I want to undo this operation, I will have to undo 50 times!! 1 time for each conversion.

Would it be possible to change this behavior to be able to undo the whole batch at once?

Thank you!!

Extension host terminated unexpectedly

Swissknife v1.3.1, available from the Microsoft Visual Studio Code Marketplace, crashes immediately with the error message "Extension host terminated unexpectedly". The last update in the Microsoft Visual Studio Code Marketplace was in April 2021 and the most recent commit on GitHub was in February 2022. I can reproduce the issue on Manjaro Linux and Mac OS using the latest version of Microsoft Visual Studio Code. The issue started with an update of Microsoft Visual Studio Code in February 2022. Maybe updating Swissknife in the official Microsoft Visual Studio Code Marketplace could help.

Suggestion: Add HEX to HSL/HSB conversion and inverse

Hi,
So far I'm loving your extension, it's becoming more and more useful over time for me.

I'm mostly using the color conversion utilities, so some things I'd love to see in this extension would be:

  • HEX to HSL conversion
  • HSL to HEX conversion
  • HEX to HWB conversion
  • HWB to HEX conversion

I'm not sure if this is possible, but it would be great if you could add these conversions as well, it'd be even more useful than it already is.

Thanks in advance,
Matteo

Bug in RGB→HEX conversion

Hi, I've noticed a bug in converting RGB colors to HEX.
When one of the values is 0 or the converted hex value has a trailing zero (i.e. 0C). the trailing zero isn't added.
An example:
The color rgb(208, 162, 0) becomes #D0A20, in this case the trailing zero for the blue channel gets lost

Thanks in advance!

[Suggestion] - Add the ability to replace the whole RGB color in hex

Hi, I'd like to suggest a quality of life improvement.
At the moment, the RGB to HEX (and viceversa) only works correctly when just the color values are selected.
I think that converting the colors even when the whole color is selected (including the function name and brackets) would be more useful.

Thanks in advance
Matteo

Shortcut for MD5?

It is possible to create a shortcut to replace String with your MD5 function ?

Multi-cursor "lorem ipsum" generation is broken

Hi.
On Visual Studio Code, when using multiple cursors and launching the "Lorem Ipsum" generators, i get one prompt per cursor (expected), but only the first value is picked.
Example:
With 4 cursors, i call the generator and insert the values: [2, 3, 4, 5].
The result is that only 2 words are generated, and only in the last cursor position.

I hope my explanation is clear enough, english is not my first language

[SUGGESTION] RGBA conversion

Hi,
seeing that the extension has RGB/HEX conversion, would it be possible to add RGBA/HEX (in #rrggbbaa format) conversion? I think it could be really useful

Thanks in advance,
Matteo

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.