Skip to content

Instantly share code, notes, and snippets.

View ephemeralrogue's full-sized avatar
🖋️
writing and reorganizing

L V N Λ C Y ephemeralrogue

🖋️
writing and reorganizing
View GitHub Profile
@ephemeralrogue
ephemeralrogue / add_then_multiply.py
Created February 27, 2025 08:55
I’m learning Python from the very beginning, and it’s been great returning to the basics. But as the early challenges are simple, I’m adding a little flavor to my solutions, to get in a little more practice with the syntax. This is my solution to a challenge where I needed to add two numbers and then multiply them by a third number.
def add_then_multiply():
num1 = int(input('Pick a number and enter it: '))
print('Yes, good.')
num2 = int(input('Now, enter another number: '))
num1 += num2
final_num = num1 * 3
if final_num == 69:
print(f'You dirty rascal you, your number is {final_num}')
else:
print(f'The total is {final_num}')
@ephemeralrogue
ephemeralrogue / gitignore_per_git_branch.md
Created April 10, 2024 20:19 — forked from wizioo/gitignore_per_git_branch.md
HowTo have specific .gitignore for each git branch

How to have specific .gitignore for each git branch

Objective

My objective is to have some production files ignored on specific branches. Git doesn't allow to do it.

Solution

My solution is to make a general .gitignore file and add .gitignore.branch_name files for the branches I want to add specific file exclusion. I'll use post-checkout hook to copy those .gitignore.branch_name in place of .git/info/exclude each time I go to the branch with git checkout branch_name.