Skip to content

Instantly share code, notes, and snippets.

View fercreek's full-sized avatar
😎
Coding coding coding

Fernando Contreras fercreek

😎
Coding coding coding
View GitHub Profile
@fercreek
fercreek / curry.js
Last active February 5, 2016 06:00
"use strict";
// Example 1
let dragon = (name, size, element) =>
name + ' is a ' +
size + ' dragon that breathes ' +
element + '!'
console.log(dragon('fluffykins', 'tiny', 'lightning'))
// Example 2
let dragon =
@fercreek
fercreek / scripy.py
Created December 21, 2015 19:54
Python - composition example
class Math:
def __init__(self, x, y):
self.x = x
self.y = y
def add(self):
return self.x + self.y
def substract(self):
return self.x - self.y
@fercreek
fercreek / abstract_factory
Created October 15, 2015 00:45 — forked from diofeher/abstract_factory
Abstract Factory Pattern implemented in Python
#!/usr/bin/python
# -*- coding : utf-8 -*-
"""
@author: Diogenes Augusto Fernandes Herminio <diofeher@gmail.com>
"""
from abc import ABCMeta
#Abstract Factory
class StandardFactory(object):