Skip to content

Instantly share code, notes, and snippets.

View xpepper's full-sized avatar
💭
😏

Pietro Di Bello xpepper

💭
😏
View GitHub Profile
@xpepper
xpepper / .rspec
Created February 7, 2014 21:23 — forked from coreyhaines/.rspec
--colour
-I app
@xpepper
xpepper / Some tools and tweaks on Mac OS X.md
Last active December 13, 2023 11:33 — forked from g3d/gist:2709563
Some tools and tweaks on Mac OS X
@xpepper
xpepper / Whiteboard Cleaner Script.md
Last active August 29, 2015 13:58 — forked from lelandbatey/whiteboardCleaner.md
Take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@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

# Original Rails controller and action
class EmployeesController < ApplicationController
def create
@employee = Employee.new(employee_params)
if @employee.save
redirect_to @employee, notice: "Employee #{@employee.name} created"
else
render :new
end
@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 / README.md
Created November 22, 2016 21:01 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


Index:

@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?