Skip to content

Instantly share code, notes, and snippets.

import asyncio
import openpyxl
import uuid
from urllib.request import urlretrieve
from unsync import unsync
from asgiref.sync import sync_to_async
from sample_django_interview.models import Category, Answer, Question
@codephillip
codephillip / interview_prep2.rst
Created August 25, 2024 20:14
interview prep blog initial notes

DSA books

Cracking the Coding Interview - The holy grail of coding interview books. It's a must read.

  1. Programming Interviews Exposed - by John Mongan, Noah Kindler and Eric Giguere, covers common coding problems and solutions, along with a thorough walkthrough of each solution.
  2. The Complete Coding Interview Guide in Java - Very helpful for your DSA prep in Java.
  3. Coding Interviews: Questions, Analysis & Solutions - Covers basics , code optimisations , different methods of tackling difficult problems , and also soft skills.
@codephillip
codephillip / interview_prep.rst
Created July 5, 2024 11:54
interview prep blog notes

Lessons

General

  • easy questions boost confidence

leetcode discussion groups - linkedlist - not common - 2 years is too old - filter latest questions

@codephillip
codephillip / weyonje gist
Created July 2, 2024 10:00
Weyonje gist
minSdkVersion 16
targetSdkVersion 30
versionCode 24
- versionName "2.1.15"
+ versionName "2.1.16"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
@@ -40,8 +40,10 @@ android {
buildConfigField "String", "SOCKET_SERVER_URL", '"http://192.168.3.45:2083"'
import csv
import random
import re
"""
Helps us find the number in between two brackets ie (33)
"""
def find_between(text, start, end):
@codephillip
codephillip / uat_extractor.py
Created August 27, 2022 15:39
uat_extractor.py
import csv
import random
import re
"""
Helps us find the number in between two brackets ie (33)
"""
def find_between(text, start, end):
return re.findall(re.escape(start) + "(.*)" + re.escape(end), text)[0].strip()
@codephillip
codephillip / classroom.py
Created August 25, 2022 06:27
classroom.py
class School:
def __init__(self, name, location):
self.name = name
self.location = location
class Student:
def __init__(self, name, age, school):
self.name = name
self.age = age
from dataclasses import dataclass, asdict
from typing import List
from ms_foobar_app.utils.utilities import snake_case_dict_to_camel
@dataclass
class SmsMessage:
phone_numbers: List[str]
message: str
from django.core.management.base import BaseCommand
from ms_foobar_app.events.event_listener import EventListener
class Command(BaseCommand):
def handle(self, *args, **options):
bus = EventListener()
bus.run()
bus.subscribe()
from ms_foobar_app.events.event_bus_root import EventBus
class EventPublisher(EventBus):
def __init__(self):
super(EventPublisher, self).__init__()
def publish(self, subject, data):
self.loop.run_until_complete(self.__publish(subject, data))