Skip to content

Instantly share code, notes, and snippets.

View im4aLL's full-sized avatar
🏠
Working from home

Md Habibullah Al Hadi im4aLL

🏠
Working from home
View GitHub Profile
@im4aLL
im4aLL / ES6-browserify-2017.js
Last active December 15, 2017 14:07
Simple and plain gulpfile.js boilerplate for project using SASS and Browserify
/*
```
npm install browser-sync gulp gulp-autoprefixer gulp-cssnano gulp-rename gulp-sass gulp-uglify gulp-watch vinyl-source-stream babelify browserify browserify-shim babel-preset-es2015 babel-core --save-dev
```
```
npm install jquery --save
npm install foundation-sites --save
```
*/
@im4aLL
im4aLL / gist:e1baaf6ed3614aa53af1
Created March 4, 2016 10:30
PHP OOP Abstract Interface Inheritance Factory Pattern Magic method
<?php
/**
* common things about a developer
*/
abstract class Developer {
protected $_languages;
protected $_characteristics;
abstract public function setLanguages($language);
abstract public function getLanguages();
@im4aLL
im4aLL / php-event-listener-example.php
Last active June 20, 2024 21:25
PHP event listener simple example
<?php
// Used in https://github.com/im4aLL/roolith-event
class Event {
private static $events = [];
public static function listen($name, $callback) {
self::$events[$name][] = $callback;
}
html {
box-sizing: border-box;
}
*,
*:before,
*:after {
box-sizing: inherit;
}
@im4aLL
im4aLL / linkedList.js
Created April 10, 2017 07:10
LinkedList Javascript
function LinkedList() {
this.list = null;
this.length = 0;
}
LinkedList.prototype.add = function(value) {
if( this.list === null ) {
this.list = this._node(value);
}
else {
@im4aLL
im4aLL / php-adapter-pattern.php
Created November 14, 2017 05:41
Design pattern adapter simple example
<?php
interface NotificationInterface {
public function send();
}
class Notification implements NotificationInterface {
public function send()
{
return 'Default notification service!';
@im4aLL
im4aLL / chain-of-responsibility-pattern.php
Created November 14, 2017 05:43
Design pattern - chain of responsibility example
<?php
abstract class Status {
protected $successor;
abstract public function check(ServerStatus $serverStatus);
public function succeedWith(Status $status)
{
$this->successor = $status;
@im4aLL
im4aLL / php-decorator-pattern.php
Created November 14, 2017 05:44
Design pattern - decorator example
<?php
/**
* PHP decorator pattern example
*/
interface TransactionInterface {
public function getCost();
}
@im4aLL
im4aLL / php-strategy-pattern.php
Created November 14, 2017 05:46
Design pattern - strategy - example
<?php
interface MailServiceInterface {
public function sendEmail();
}
class SMTPService implements MailServiceInterface {
public function sendEmail()
{