Skip to content

Instantly share code, notes, and snippets.

View cereblanco's full-sized avatar
🎯

Cere Blanco cereblanco

🎯
View GitHub Profile
@cereblanco
cereblanco / clean-code-recaps.md
Last active November 17, 2022 03:32
Clean Code Recaps

Names

  1. Choose your names thoughtfully

  2. Communicate your intent

  3. Avoid Disinformation

    • don't let the names' meaning drift; rename if necessary
  4. Pronounceable Names

@cereblanco
cereblanco / list_comprehension.py
Created July 3, 2021 00:35
List Comprehension Example
# Given three integers `x`, `y` and `z` representing the dimensions of a cuboid along with an integer `n`.
# Print a list of all possible coordinates given by `(i, j, k)` on a 3D grid where the sum of `i + j + k` is NOT equal to `n`.
# Here, `0<=i<=x;0<=j<=y;0<=k<=z`
def for_loops(x: int, y: int, z: int, n: int):
result = []
for k in range(z + 1):
for j in range(y + 1):
for i in range(x + 1):
@cereblanco
cereblanco / SpeakingConfidentlyAndEffectively.md
Last active November 17, 2022 03:35
SpeakingConfidentlyAndEffectively.md
@cereblanco
cereblanco / Storing-Images-On-Github.md
Created June 5, 2021 03:44 — forked from joncardasis/Storing-Images-On-Github.md
Storing Images and Demos in your Repo

Storing Images and Demos in your Repo

In this quick walkthough you'll learn how to create a separate branch in your repo to house your screenshots and demo gifs for use in your master's readme.

How to

1. Clone a fresh copy of your repo

In order to prevent any loss of work it is best to clone the repo in a separate location to complete this task.

2. Create a new branch

Create a new branch in your repo by using git checkout --orphan assets

@cereblanco
cereblanco / pyenv-cheatsheet.md
Last active May 17, 2021 12:46
PyEnv CheatSheet

PyEnv Cheatsheet

IMPORTANT!

  • pyenv manages multiple versions of Python
  • pyenv-virtualenv manages virtual environments for different versions of Python

Installation

  • brew install pyenv installs pyenv
@cereblanco
cereblanco / powers-of-two.md
Created May 17, 2021 03:42
Powers of Two Table

Powers of Two Table

Power Exact Value Approx Value Bytes
7 128
8 256
10 1024 1 thousand 1 KB
16 65,536 64 KB
20 1,048,576 1 million 1 MB
30 1,073,741,824 1 billion 1 GB
@cereblanco
cereblanco / rebase_forked_repo.sh
Created April 30, 2021 02:23
Rebase forked repo
#!/bin/bash
git fetch upstream
git checkout master
git rebase upstream/master
@cereblanco
cereblanco / docker-compose.yaml
Last active July 1, 2021 10:37
Standalone mongoDB instance into a replica set in docker-compose
version: "3.8"
services:
mongodb:
image: mongo:4.4
container_name: mongodb
# we need a constant hostname for --bind_ip
hostname: mongodb.test
volumes:
- data_db:/data/db
@cereblanco
cereblanco / pyproject.toml
Last active June 18, 2021 01:25
pyproject.toml
[tool.black]
line-length = 99 # override black's default line-length
exclude = '''
/(
\.git
| \.mypy_cache
| \.tox
| venv
| \.venv
| _build
@cereblanco
cereblanco / vscode_settings.json
Last active September 30, 2023 11:10
VSCode isort and black settings
{
"editor.formatOnSave": true,
"python.pythonPath": "./workspace_venv/bin/python3",
"python.formatting.provider": "black",
"python.formatting.blackArgs": [
"--line-length=99"
],
"python.sortImports.args": [
"--profile", "black"
],