Skip to content

Instantly share code, notes, and snippets.

View italolelis's full-sized avatar
:octocat:

Ítalo Vietro italolelis

:octocat:
View GitHub Profile

Keybase proof

I hereby claim:

  • I am italolelis on github.
  • I am italolelis (https://keybase.io/italolelis) on keybase.
  • I have a public key whose fingerprint is 27B9 B816 7600 43BC E8FF F8E1 36A7 E149 B062 CBDA

To claim this, I am signing this object:

@italolelis
italolelis / service.go
Last active January 18, 2019 14:07
Order repository definition
// WriteRepository represents the write operations for an order
type WriteRepository interface {
Add(context.Context, *Order) error
Remove(context.Context, uuid.UUID) error
}
// ReadRepository represents the read operations for an order
type ReadRepository interface {
FindOneByID(context.Context, uuid.UUID) (*Order, error)
}
@italolelis
italolelis / order.go
Last active January 18, 2019 14:09
Order modelling
// Order represents a coffee order
type Order struct {
ID uuid.UUID `json:"id" db:"id"`
CreatedAt time.Time `json:"created_at" db:"created_at"`
Items Items `json:"items" db:"items"`
CustomerName string `json:"customer_name" db:"customer_name"`
}
// Items are a collection of order items
type Items []*Item
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/Users/italolelis/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="refined"
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',

Keybase proof

I hereby claim:

  • I am italolelis on github.
  • I am italolelis (https://keybase.io/italolelis) on keybase.
  • I have a public key whose fingerprint is 194A 33A6 61DB F72D 0C59 DED3 6357 2055 E89B 5459

To claim this, I am signing this object:

@italolelis
italolelis / flatMap.php
Last active July 14, 2016 20:43
FlatMap implementation in PHP, following the Reactive Extensions intiative
function flatMap($data, \Closure $p)
{
$collection = call_user_func_array("array_map", array($p));
return iterator_to_array(new \RecursiveIteratorIterator(
new \RecursiveArrayIterator($data)), false);
}