Skip to content

Instantly share code, notes, and snippets.

View xpepper's full-sized avatar
💭
😏

Pietro Di Bello xpepper

💭
😏
View GitHub Profile
#!/bin/bash
set -e
set -o pipefail
echo '***Start***'
INSTRUCTION="If you want to deploy, try running the script with 'deploy stage region profile', e.g. 'deploy dev eu-west-1 non-prod'"
if [ $# -eq 0 ]; then
echo "Missing arguments."

Before to start

In JavaScript there is NO concept of Class.

Everything is an Object.

Inheritance between objects is achieved with a mechanism known as Prototypal Inheritance.

We can create Objects and then link them together OLOO (Objects-Linked-to-Other-Objects).

Continued from I'm learning vim. Here's how I'm doing it, by Chris Geihsler

I've committed to learning vim to become more productive without the crutch of an expensive tool and to decouple myself from a specific OS.

Here's what I've done so far:

@xpepper
xpepper / when to use TDD.md
Last active April 25, 2019 17:32 — forked from practicingruby/x.md
Gregory Brown's view on "when to use TDD"

There's no general rule you can follow here, because it's always going to depend on context. In my experience the kind of feedback loops you create, and the kind of safety nets you need are defined entirely by the domain, the organization, and the team culture.

Here are a few examples:

  1. I do a bit of work for a medium-sized dental clinic. The business manager there is really fun to work with, but has the tendency of changing his mind six times before he settles his ideas. So when he asks for a report, I don't put any effort at all into writing tests or worrying about minor bugs even, because my only goal is to flesh out in code something vaguely resembling what he asked for.

Often times, this means doing a handful of 30 minute prototypes until the requirements settle, each of which would have taken me 2 hours if I drove them via TDD. When things finally cool down, I evaluate the complexity and maintainability of the resulting code and either leave it untested, add some acceptance tests, backfill unit tes

@xpepper
xpepper / CleanCode episode 2 on names.md
Last active April 25, 2019 17:32 — forked from xplayer/CleanCode.2.names.md
CleanCode episode 2 on names

Names

The name that you use should reveal your intent

  • comments are a smell of a badly chosen name!
  • Only choose names that communicate your intent

Use pronounceable names

@xpepper
xpepper / CleanCode episode 3 on functions.md
Last active April 25, 2019 17:32 — forked from xplayer/CleanCode.3.functions.md
CleanCode episode 3 on functions

Functions

Functions should be small

Four to six lines long

  • "A long function is where the classes go to hide"

Functions should do only one thing

@xpepper
xpepper / Learning Object Oriented Python.md
Last active April 25, 2019 17:30 — forked from briankung/Learning Object Oriented Python.md
Learning Object Oriented Python

Learning Object Oriented Python

I wrote this as a guide for a financial analyst friend of mine looking to learn Python. He is already fairly well versed in doing Project Euler problems in Ruby. All italicized text is for the benefit of any other readers, such as yourself.

Each section is divided into a short resource (10 minutes or less), a long resource (days to weeks or more), and a challenge.

~

So what you're looking to do is to be able to recreate financial models in code. And other types of models. This is a noble pursuit.

@xpepper
xpepper / service-checklist.md
Created January 13, 2017 23:21 — forked from acolyer/service-checklist.md
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@xpepper
xpepper / tdd-thoughts-by-dave-schinkel.md
Last active April 25, 2019 17:27 — forked from dschinkel/tdd-thoughts-by-dave-schinkel.txt
What Does TDD Give Me in terms of a Design Activity?

TDD

Tests and the Red | Green | Blue cycle put pressure on your design all the time as you code. Your design decisions are guided by that pressure.

As Corey Haines once stated: "It's like having a little buddy as you code, helping you along, pointing things out such as when your design sucks, when you've broken something, etc."

  • forces you to only create enough code to make a test pass (you’re keeping lean all the time)
  • you won’t be able to write the next test if you have code that’s too coupled
  • you’ll know immediately when you’ve broken behavior. This is different than test after.
@xpepper
xpepper / Bank account kata (Sandro Mancuso).md
Last active April 25, 2019 17:26 — forked from abachar/kata.md
The Bank Account code kata (inspired by Sandro Mancuso)

Bank account kata

Think of your personal bank account experience When in doubt, go for the simplest solution

Requirements

  • Deposit and Withdrawal
  • Account statement (date, amount, balance)
  • Statement printing

User Stories

Deposit: