Skip to content

Instantly share code, notes, and snippets.

View bdieu178's full-sized avatar

Bryan Dieudonne bdieu178

View GitHub Profile
@bdieu178
bdieu178 / list.md
Created January 5, 2021 07:59 — forked from ih2502mk/list.md
Quantopian Lectures Saved

The three design patterns (Adapter, Facade and Bridge) all produce the result of a clean public API. The difference between the patterns are usually due to a subtle context shift (and in some cases, a behavioural requirement).

Adapter

The primary function of an Adapter is to produce a unified interface for a number of underlying and unrelated objects.

You will notice this pattern being utilised in many applications. For example, ActiveRecord (the popular Ruby ORM; object-relational mapping) creates a unified interface as part of its API but the code underneath the interface is able to communicate with many different types of databases. Allowing the consumer of the API to not have to worry about specific database implementation details.

The principle structure of this pattern is:

@bdieu178
bdieu178 / errno-base.h
Created July 25, 2018 02:42 — forked from nullunar/errno-base.h
Linux Kernel Error Number Define
#ifndef _ASM_GENERIC_ERRNO_BASE_H
#define _ASM_GENERIC_ERRNO_BASE_H
#define EPERM 1 /* Operation not permitted */
#define ENOENT 2 /* No such file or directory */
#define ESRCH 3 /* No such process */
#define EINTR 4 /* Interrupted system call */
#define EIO 5 /* I/O error */
#define ENXIO 6 /* No such device or address */
#define E2BIG 7 /* Argument list too long */
@bdieu178
bdieu178 / gist:1306d34158be471168c67c1048bbbd2d
Created May 17, 2018 16:55 — forked from steveclarke/gist:1411146
Git: Setting up a Remote Repository and Doing Initial Push

Setup remote repository:

ssh git@example.com
mkdir my_project.git
cd my_project.git
git init --bare

On local machine:

cd my_project

@bdieu178
bdieu178 / gist:e80c13fd5963f2217786cec64c843ab5
Created May 17, 2018 16:55 — forked from steveclarke/gist:1411146
Git: Setting up a Remote Repository and Doing Initial Push

Setup remote repository:

ssh git@example.com
mkdir my_project.git
cd my_project.git
git init --bare

On local machine:

cd my_project