Skip to content

Instantly share code, notes, and snippets.

beyondxscratch /
Last active October 8, 2018 22:52
Install Dependency-Track as a Docker Container
docker pull owasp/dependency-track
docker volume create --name dependency-track
docker run -d -p 8080:8080 –name dependency-track -v dependency-track:/data owasp/dependency-track
View retrieves-next-showings.feature
Feature: As a cinephile In order to never miss a minute of a movie I want to know what are the next showings of the movie theater
Given a cinephile
Scenario: Looking for the next showings before the start of the last one
Given the last showing is not started yet
When the user asks for the next showings
Then the returned showings are not started yet
And the returned showings are not starting in the next 15 minutes
public class StepDefs implements En {
public StepDefs() {
Given("^a cinephile$", () -> me = new Cinephile("me"));
Given("^the last showing is not started yet$",
() -> lastShowing = new Showing(now().plusHours(3)));
When("^the user asks for the next showings$",
() -> nextShowings = searchShowings.searchNextShowingsFor(me));
View table-bad-pattern.feature
Given the showing:
| name | schedule | director | rating | duration |
| Gore Movie | 21H00 | Jhon Doe | NC-17 | PT2H5M |
When a child tries to buy a ticket for this showing
Then the purchase is forbidden
View ForbiddenPurchase.feature
Given a NC-17 rated showing
When a child tries to buy a ticket for this showing
Then the purchase is forbidden
View karate-profile.feature
Feature: Profile endpoint
Scenario: creating a profile
Given path 'profiles'
And request
{ "topics": [{"name": "DDD"},{"name": "Hexagonal Architecture"}],"talksFormats": ["QUICKIE","CONFERENCE"] }
When method post
Then assert responseStatus == 201
"Select * from users where username='" + name + "' and password='" + password + "'",
View sqlInjection.sql
Select * from users where username='' OR '1'='1' LIMIT 1 --' and password=''
beyondxscratch /
Last active July 27, 2019 22:03
Example of a boilerplate bean factory
public class DomainConfiguration {
public RetrieveSanitaryGrades retrieveSanitaryGrades() {
return new RetrieveSanitaryGrades();
public SearchRestaurants restaurantsFinder(Restaurants restaurants,
View domainannotations.kt
import java.lang.annotation.Inherited
annotation class DomainService