Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Kissable is a gem used to create, track, and store information for A/B tests in user cookies.
Add this line to your application's Gemfile:
gem 'kissable'
And then execute:
$ bundle
Or install it yourself as:
$ gem install kissable
Kissable helps you run A/B tests by breaking up your users into test groups (e.g. Original vs. Variant). Name your test, list your test groups, and the ratio at which people should be distributed to each group. Kissable does the assignment pseudo-randomly.
For anonymous users cookies must be enabled. Cookies are used to assign a user to a group and keep him there. For logged in users a unique identifier (e.g. login) is used instead for the same purpose.
You instantiate the object with these items.
Kissable::AB.new(testname, groups, ratio)
testname
(required) This should be unique per test. It both passes the property to KM tracking as well as helps generate unique user groups for the test.groups
(optional) This is used to name the groups used in the test. It will accept up to four group names. Defaults to %w{Original Variant}
.ratio
(optional) The ratio of how you want users sent to the specified groups. It expects all weightings to equal 100. It defaults to an even weight for all groups in the test.group
and use it to set up a switch in the relevant controller.# home_controller.rb
def index
@ab_test = Kissable::AB.new('top-navigation test')
@users_ab_group = @ab_test.group(cookies)
case @users_ab_group
when 'Original'
render 'index'
else
render 'index-variant'
end
end
#tracking_script
instance method. ab_test = Kissable::AB.new('top-navigation test')
users_ab_group = ab_test.group(cookies)
ab_test.tracking_script(users_ab_group)
ab_test = Kissable::AB.new('top-navigation test')
users_ab_group = ab_test.group(email)
# Add your custom tracking code here.
ab = Kissable::AB.new('some cool test')
ab.group(cookies)
Sinatra handles cookies much differently than Rails. Sinatra stores the cookies which were sent in the request object in request
and the cookies which will be sent back to the user in the response
object. In order to make this as easy as possible, Kissable uses a Sinatra cookie adapter. This adapter needs to be instantiated with the request
and response
objects, then passed to group
.
sca = Kissable::SinatraCookieAdapter.new(request, response)
ab = Kissable::AB.new('some cool test')
users_ab_group = ab.group(sca)
Kissable allows you some potential configurations.
Kissable.configure do |config|
config.logger = Logger.new(STDOUT)
config.domain = '.kissmetrics.com'
end
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that kissable 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.