Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Yet another url shortner?
corto is a ruby gem that shorten a URL for you and store the result in a SQLite3 database. Why the world needs another url shortener? Well, true to be told I don't know the answer and I'm pretty sure this code is far away from being revolutionary.
However... corto is funniest!
Usage
Using corto as standalone utility is straightforward. In case you want to shorten an url you just launch the program with the url as parameter.
% bin/corto http://www.armoredcode.com
% corto: http://www.armoredcode.com shrunk as ji5jnu
Please note that you've to supply a valid URL, since internally it's parsed and rejected anything but HTTP and HTTPS verbs.
% bin/corto funnystatementhere
% corto: it seems funnystatementhere is not a valid url to shrink
If you want to deflate a shrunk url, you have just to specify the '-d' flag this way.
% bin/corto -d ji5jnu
% corto: ji5jnu deflated is http://www.armoredcode.com
Super easy, isn't it? Now, go ahead and shrink the web!
API
A simple corto shortening session start with class initialization, optionally telling which SQLite3 database to use and then mastering the parameter.
require 'corto'
...
corto = Corto.new # we're now saying the gem we want to use it's internal database stored in db/corto.db
s = corto.shrink('http://www.armoredcode.com')
# s now stores the shrinked url that is already added to database if not present.
# If you'll pass an invalid url to shrink(), nil will be returned instead
Deflating a URL is super easy as well
# The deflate process is quite straightforward as well
d = corto.deflate(s)
# d has now the deflated url or nil if that url was not found
You can also count how many urls contained into db
# If you want to know how many urls you have in your database, just call the count() method.
puts 'Hey, I have stored ' + corto.count() + ' urls'
And finally you can purge your db
# Tired of your database and time for a massive clean has come? Let's purge the db.
corto.purge
# corto.count == 0 now
Note on Patches/Pull Requests
Copyright
Copyright © 2011 Paolo Perego. See LICENSE for details.
FAQs
Unknown package
We found that corto demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.