This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def goLeft(tree): | |
| left_sum = 0 | |
| power_count = 1 | |
| descending = True | |
| while descending: | |
| for i in range( (2**power_count)-1, (2**(power_count+1))-1 ): | |
| level_span = ((2**power_count)-1) | |
| range_len = len(range( (2**power_count)-1, (2**(power_count+1))-1)) | |
| try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # WARNING: THIS WILL GET RID OF THE COMMITS ON YOUR FEATURE BRANCH TOO! | |
| # Original steps | |
| # 1. Start with a clean version branch. | |
| # 2. git reset master | |
| # 3. git add . (notice trailing dot in there) | |
| # 4. git commit -m "A really meaningful commit message" | |
| # 5. git push --force | |
| git reset master && \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| object fibonnaci { | |
| var lastMinusOne = 0 | |
| var last = 0 | |
| for (count <- 1 to 10) { | |
| if (count == 2) lastMinusOne = lastMinusOne + 1 | |
| println({val current = last + lastMinusOne; current }) | |
| val tempLast = last | |
| last = last + lastMinusOne // aka current | |
| lastMinusOne = tempLast |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| from random import choices | |
| name='Scrabble' | |
| def split(word): | |
| return [char for char in word] | |
| score_map = { | |
| "E": 1, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import unittest | |
| import pairing_exercise | |
| class TestPairingExercise(unittest.TestCase): | |
| def test_calculate(self): | |
| self.assertEqual(pairing_exercise.get_score('GUARDIAN1'), 10) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| * { background-color: rgba(255,0,0,.2); } | |
| * * { background-color: rgba(0,255,0,.2); } | |
| * * * { background-color: rgba(0,0,255,.2); } | |
| * * * * { background-color: rgba(255,0,255,.2); } | |
| * * * * * { background-color: rgba(0,255,255,.2); } | |
| * * * * * * { background-color: rgba(255,255,0,.2); } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # To show the current link state | |
| ip link show | |
| # To disable the wlp3s0 interface (the built in one) | |
| if=wlp3s0 | |
| sudo ip link set $if down | |
| # or | |
| sudo ip link set wlp3s0 down |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git co -b feature-name | |
| # ... do some stuff | |
| git commit -am "message" | |
| # .. go away for a while | |
| git fetch origin/master | |
| git rebase origin master | |
| # ... do some more work | |
| git add . | |
| git commit --amend |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| is:open is:pr -author:app/dependabot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## See https://stackoverflow.com/a/66766065/8249410 | |
| ## IN A REBASE, THE MEANING OF OURS / THEIRS IS REVERSED | |
| ## Because we're replaying commits over the other branch, the commits you're adding over the | |
| ## base branch become 'theirs' wrt the base branch | |
| ## capeesh? | |
| ## To choose the influence of `origin/main` for rebase conflicts | |
| git rebase -s recursive -X ours origin/main | |
| ## To choose the influence of your current branch for rebase conflicts |
OlderNewer