Skip to content

Instantly share code, notes, and snippets.

View georgebullock's full-sized avatar
📈
Always leveling up

George Bullock georgebullock

📈
Always leveling up
View GitHub Profile
@georgebullock
georgebullock / window_sliding_in_javascript.js
Created January 28, 2023 12:14 — forked from scaryguy/window_sliding_in_javascript.js
Window Sliding Technique in JavaScript
// This gist is for my YouTube video which I tried to explain Window Sliding Technique.
// You can watch it from here: https://youtu.be/ZlnZkfEcbxs
//
// Given an array of integers of size ‘n’. Calculate the maximum sum possible
// for ‘k’ consecutive elements in the array.
//
// Input : [10, 20, 30, 40, 50, 60, 70]
//
// k = 3
// Output : 180
@georgebullock
georgebullock / two_pointers.js
Created January 28, 2023 12:13 — forked from scaryguy/two_pointers.js
Two Pointers Technique (in JavaScript)
// This gist is for my YouTube video which I tried to explain Window Sliding Technique.
// You can watch it from here: https://youtu.be/guDU5HnLqAs
// Given a sorted array A (sorted in ascending order), having N integers,
// find if there exists any pair of elements (A[i], A[j]) such that
// their sum is equal to X.
//
// Input: A = [2,3,4,5,6,7,8,9], k= 10
// Output: true
// NOTE: We slightly changed the question and the output in the video. We're returning pair indexes as an array.
@georgebullock
georgebullock / George Bullock README.md
Last active September 19, 2023 09:02
George Bullock README.md

George Bullock README.md

Who Am I

Non-Work

Above all, I'm a human being. I have a variety of strengths and weaknesses, emotional ups and downs, and I make mistakes.

I spend a lot of time thinking about thinking. I'm curious about the World and how it works, which drives me to study things way outside the scope of my career. Currently, I'm into complexity science. In general, personal development is an important part of my life. My personal motto is "always leveling up" because I'm always working on something to level myself up in some way.

@georgebullock
georgebullock / clean_code.md
Created November 11, 2020 07:18 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@georgebullock
georgebullock / comment-tags.md
Last active April 29, 2020 13:19
React Interactive Dashboard Draft MySQL Schema v1.0.0
field type specs
comment_id INT(11)
@georgebullock
georgebullock / react-interview-questions.md
Last active April 19, 2020 13:46
React Interview Questions

REACT INTERVIEW QUESTIONS

1 What is React?

React is JavaScript library that makes it easy develop UI

2 What are the major features of React?

  • Virtual DOM
  • Templating via JSX
  • Data handling via props
  • State management via state
@georgebullock
georgebullock / frontend-interview-questions.md
Last active October 7, 2021 19:04
Frontend Interview Questions

FRONTEND INTERVIEW QUESTIONS

1 - Which version control systems are you familiar with? How do you share code between projects in a lossless way?

I'm familiar with git and subversion.

I know of three options for sharing code between projects:

  • Cut and paste - Share code manually. Low coupling. High maintenance.
@georgebullock
georgebullock / react-unit-test-structure.md
Last active October 21, 2020 14:05
A generic template for structuring React unit tests. The template uses Jest, but it can be adapted to work with other testing libraries.

How to Structure React Unit Tests (with Jest)

Main Template

// A utility method for working with test props (can also be imported)
const createTestProps = (props) => {
  return {
    // common props
    id: 1,
    productTitle: `Lightsaber`,
@georgebullock
georgebullock / react-testing-library-reference.md
Last active March 20, 2020 13:36
A React Testing Library Reference

React Testing Library Reference

Querying Your React Tree

React Testing Library has methods for several types of queries. There are six query method variants:

  • getBy*() - returns the first matching element and throws when an element not found or more than one element found;
  • queryBy*() - returns the first matching element but doesn’t throw;
  • findBy*() - returns a promise that resolves with a matching element, or rejects when an element not found after a default timeout or more than one element found;
  • getAllBy*(), queryAllBy*(), findAllBy*(): same as above but return all found elements, not just the first one.

And the queries are:

@georgebullock
georgebullock / villains.json
Created March 7, 2020 19:07
Villains.json is a file that I use for mocking API requests.
[
{
"name":"Hugo Drax",
"bio":"Plotted to poison Earth's atmosphere from space via a nerve agent.",
"picture":"https://dummyimage.com/600x400/000000/fff&text=D",
"skills":[{"html":50},{"css":30},{"javaScript":95}]
},
{
"name":"Alec Trevelyan",
"bio":"Mastermined a plot to use an EMP weapon to destroy London's economy",