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.
Time Ranges that are actually useful.
Add this line to your application's Gemfile:
gem 'timerage'
And then execute:
$ bundle
Or install it yourself as:
$ gem install timerage
require 'timerage'
a_time = Timerage("2016-01-18T22:25:37Z")
# => 2016-01-18 22:25:37 +0000
Timerage(a_time)
# => 2016-01-18 22:25:37 +0000
Timerage("2016-01-18T21:25:37+00:00/2016-01-18T22:25:37+00:00")
# => 2016-01-18 21:25:37 +0000...2016-01-18 22:25:37 +0000
interval = Timerage((a_time-3600)...a_time)
# => 2016-01-18 21:25:37 +0000...2016-01-18 22:25:37 +0000
interval.step(30*60).map { |time| time }
# => [2016-01-18 21:25:37 +0000, 2016-01-18 21:55:37 +0000]
interval.slice(30*60).map { |time| time }
# => [2016-01-18 21:25:37 UTC...2016-01-18 21:55:37 UTC, 2016-01-18 21:55:37 UTC...2016-01-18 22:25:37 UTC]
interval.iso8601
# => "2016-01-18T21:25:37+00:00/2016-01-18T22:25:37+00:00"
Supports most range/set comparisons
#overlap?
#cover?
#adjacent_to?
#==
interval + Timerage("2016-01-18T20:25:37+00:00/2016-01-18T21:25:37+00:00")
# => 2016-01-18 20:25:37 UTC..2016-01-18 22:25:37 UTC
interval.duration
# => 3600.0
This doesn't fix the #each
method to do anything useful, you still can't
blindly iterate over a range of time. You can use the #step(seconds)
method
however, which makes more sense anyway. (what does it even mean to iterate
over a time range? What is the next time after "now"? How many steps should we
take?)
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that timerage demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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.