Skip to content

Instantly share code, notes, and snippets.

View braddotcoffee's full-sized avatar

Brad // Cloudzy braddotcoffee

View GitHub Profile
{
"terminal.integrated.defaultProfile.windows": "Git Bash",
"remote.SSH.path": "/usr/bin/ssh"
}
@braddotcoffee
braddotcoffee / .vimrc
Created March 14, 2020 20:06
Minimal .vimrc
let mapleader=","
set linebreak " turn on word wrapping
set tabstop=2
set softtabstop=0 noexpandtab "number of spaces per tab when editing a file
set expandtab "turn <TAB> into 4 spaces. Good for python and bash
set shiftwidth=2
set relativenumber " Show relative numbers
set number " Show line numbers
@braddotcoffee
braddotcoffee / gist:b146faef7fa7274ec24ca78cb57065f3
Created March 19, 2020 01:27
Generate new SSH Key and add to agent
ssh-keygen -t rsa -b 4096 -C "bradfordbonanno@gmail.com"
eval $(ssh-agent -s)
ssh-add ~/.ssh/id_rsa
sudo apt-get install xclip
xclip -sel clip < ~/.ssh/id_rsa.pub
.controller.ds4.white {
background-image: url(ControllerBaseFile.svgz);
}
@braddotcoffee
braddotcoffee / raze_academy_part_2.md
Last active January 26, 2023 21:02
Raze Academy Part 2

Overview

At this stage, I think it's the most valuable to have a few simple entry plans that you're comfortable with on each map. For the purposes of this doc, I'm not going to justify these as "I've seen pros do them." They're based off ideas that I'd seen pros do, but they're extremely simple satchels that are definitely better than having no satchels planned at all.

There are 7 maps in rotation. My personal philosophy is that having an "OK" plan on all 7 is better than having flawless plans on 1. With that in mind, below are the satchels I'd recommend being consistent with on each map.

Ascent

@braddotcoffee
braddotcoffee / timezones.txt
Created June 29, 2023 02:25
Aimlabs Tracking Valid Timezones
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Asmera
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
class Solution:
def _repeated_number(self, idx: int, sorted_nums: List[int]):
return idx > 0 and sorted_nums[idx] == sorted_nums[idx - 1]
def _skip_duplicates(self, lower: int, upper: int, sorted_nums: List[int]):
while self._repeated_number(lower, sorted_nums) and lower < upper:
lower += 1
return lower, upper
def threeSum(self, nums: List[int]) -> List[List[int]]:
@braddotcoffee
braddotcoffee / solution.py
Created October 4, 2023 17:50
128. Longest Consecutive Sequence
class Solution:
def _is_start_of_sequence(self, num: int, unique_nums: set[int]):
return (num - 1) not in unique_nums
def longestConsecutive(self, nums: List[int]) -> int:
unique_nums = set(nums)
longest = 0
for num in unique_nums:
if not self._is_start_of_sequence(num, unique_nums):
continue
@braddotcoffee
braddotcoffee / solution.py
Created October 4, 2023 17:52
150. Evaluate Reverse Polish Notation
class Solution:
VALID_OPERATIONS = set(["+", "-", "*", "/"])
def evalRPN(self, tokens: List[str]) -> int:
nums = []
for token in tokens:
if token not in Solution.VALID_OPERATIONS:
nums.append(int(token))
continue
operand_two = nums.pop()
@braddotcoffee
braddotcoffee / solution.py
Created October 4, 2023 18:53
22. Generate Parentheses
class Solution:
def _close_out_stack(self, curr_str: str, open_count: int):
return curr_str + (")" * open_count)
def _generate_path(self, curr_str: str, open_count: int, paren_remaining: int):
if paren_remaining == 0:
return [self._close_out_stack(curr_str, open_count)]
open_path = self._generate_path(curr_str + "(", open_count + 1, paren_remaining - 1)
close_path = []
if open_count > 0: