Skip to content

Instantly share code, notes, and snippets.

View cherifGsoul's full-sized avatar
🎯
Focusing

Cherif Bouchelaghem cherifGsoul

🎯
Focusing
View GitHub Profile
@cherifGsoul
cherifGsoul / bdd_cucumber-js.md
Created July 16, 2017 01:03 — forked from steckel/bdd_cucumber-js.md
Workflow: Behavior Driven Development/Design for Front End Development (JavaScript)

Beyond any other definition, Behavior Driven Development/Design ("BDD") is a philosophy.

What is "BDD"?

"BDD" is a set of tools and techniques that exist to support one idea: good software is written to meet the needs of the stakeholders (typically clients).

These stakeholders know their business better than the people designing the software. It is the responsibility of developers to capture the business requirements and translate them into software.

BDD tools facilitate this as a process by letting developers author features first, which capture requirements in a domain-specific language. Code is developed by working on these high-level features, and then on code specifications.

@cherifGsoul
cherifGsoul / DDD, CQRS & ES.md
Created February 25, 2017 19:27 — forked from rasheedamir/DDD, CQRS & ES.md
DDD, CQRS & ES!

To implement command processing we need the following pieces:

  • Commands which request that something should happen, i.e. some state change
  • Events which indicate that something has happened
  • Aggregates that handles Commands and generates Events based on the current state
  • Event store which stores all events that has happened
  • Application services that receives Commands and routes it to the appropriate aggregate

https://github.com/rasheedamir/event-sourcing-in-practice

@cherifGsoul
cherifGsoul / index.php
Created December 25, 2016 20:01 — forked from tuupola/index.php
Use JWT Authentication middleware with ZF Expressive
<?php
use Zend\Expressive\AppFactory;
use Firebase\JWT\JWT;
use Slim\Middleware\JwtAuthentication;
chdir(dirname(__DIR__));
require "vendor/autoload.php";
$app = AppFactory::create();
@cherifGsoul
cherifGsoul / JavascriptCodeReusePattern
Created September 11, 2016 16:35 — forked from JAzzNoTE/JavascriptCodeReusePattern
Javascript Code Reuse Patterns
----------
### Object Creation Patterns
#### Module & Revelation Pattern
Module pattern can define private properties.
It includes several patterns:
@cherifGsoul
cherifGsoul / behat-reference.feature
Created August 14, 2016 16:24 — forked from mnapoli/behat-reference.feature
Behat Mink reference
# Given
Given I am on [the] homepage
Given I am on "url"
# When
When I go to [the] homepage
When I go to "url"
When I reload the page
// Alerts
@include alert-variant($background, $border, $text-color);
// Background Variant
@include bg-variant($parent, $color);
// Border Radius
@include border-top-radius($radius);
@include border-right-radius($radius);
@include border-bottom-radius($radius);
@cherifGsoul
cherifGsoul / repo_pattern.py
Created June 14, 2016 14:29 — forked from uris77/repo_pattern.py
Example of Repository Pattern with SQLAlchemy
# This is a very crud example of using the Repository Pattern with SQLAlchemy. It allows me to completely ignore interactions with
# the database. This is only pulled in whenever I require to persist or retrieve an object from the database. The domain/business
# logic is entirely separated from persistence and I can have true unit tests for those.
# The tests for persistence are then limited to very specific cases of persistence and retrieving instances, and I can do those
# independent of the business logic. They also tend to be less tests since I only need to test them once.
/*
* twitter-entities.js
* This function converts a tweet with "entity" metadata
* from plain text to linkified HTML.
*
* See the documentation here: http://dev.twitter.com/pages/tweet_entities
* Basically, add ?include_entities=true to your timeline call
*
* Copyright 2010, Wade Simmons
* Licensed under the MIT license
/*
* twitter-entities.js
* This function converts a tweet with "entity" metadata
* from plain text to linkified HTML.
*
* See the documentation here: http://dev.twitter.com/pages/tweet_entities
* Basically, add ?include_entities=true to your timeline call
*
* Copyright 2010, Wade Simmons
* Licensed under the MIT license