Skip to content

Instantly share code, notes, and snippets.

Avatar
💻✈️📷🍻🐱⚽️

Cédric Blondeau cedricblondeau

💻✈️📷🍻🐱⚽️
View GitHub Profile
@cedricblondeau
cedricblondeau / go-simple-calculator.md
Last active Nov 7, 2016
Evaluates string expressions with positives integers, parentheses and +/- operators only.
View go-simple-calculator.md

go-simple-calculator

Evaluates string expressions with positives integers, parentheses and +/- operators only.

Method #1 - Calculate & Replace

Naive way to solve an expression, like a human would do with paper and pen.

Example:

| | Input | Output |

@cedricblondeau
cedricblondeau / phoneletters.go
Last active Nov 2, 2016
Generates all the words that can be made for given a phone number.
View phoneletters.go
package phoneletters
import (
"bytes"
"strconv"
"strings"
)
// Generator is a word generator for phone numbers
type Generator struct {
@cedricblondeau
cedricblondeau / ImageChooser.php
Created Jan 14, 2016
Image Chooser for Magento2 widgets
View ImageChooser.php
<?php
namespace Vendor\Module\Block\Adminhtml\Widget;
class ImageChooser extends \Magento\Backend\Block\Template
{
/**
* @var \Magento\Framework\Data\Form\Element\Factory
*/
protected $_elementFactory;