Skip to content

Instantly share code, notes, and snippets.

View LukeberryPi's full-sized avatar

LukeberryPi LukeberryPi

View GitHub Profile
@LukeberryPi
LukeberryPi / rebase.MD
Last active January 27, 2025 13:38
rebase article

Understanding Git Rebase: A Step-by-Step Guide

Git is a powerful version control system that allows developers to manage changes to their code effectively. One of the key features of Git is the ability to rebase branches, which can help maintain a clean and organized project history. In this article, we will explain the concept of rebasing step by step, provide examples of when things go right, and highlight potential pitfalls to avoid.

What is Git Rebase?

Rebasing is a Git command that allows you to move or combine a series of commits from one branch onto another. When you rebase, you take the changes from your current branch and apply them on top of another branch, effectively rewriting the commit history. This process can make your project history more linear and easier to follow, especially when integrating changes from multiple developers.

How to Start a Rebase

@LukeberryPi
LukeberryPi / fix.txt
Created December 18, 2024 16:17
WAGTAIL DJANGO AttributeError: 'NoneType' object has no attribute '_inc_path'
WAGTAIL DJANGO AttributeError: 'NoneType' object has no attribute '_inc_path'
Traceback (most recent call last):
File "/opt/patient_portal/lib/python3.8/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
File "/opt/patient_portal/lib/python3.8/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/var/www/html/patient-portal-django/./location/views.py", line 55, in create_location_page_drafts
location_index_page.add_child(instance=location_page)
File "/opt/patient_portal/lib/python3.8/site-packages/treebeard/mp_tree.py", line 1091, in add_child
@LukeberryPi
LukeberryPi / review.md
Created September 1, 2024 18:57
my code review for a coding assignment (movieland)
  • npm install was broken because the dependency node-sass. changing to the sass LTS fixed it.
  • create-react-app is no longer recommended by the React team. for the next SPA we build, we can consider using Vite instead. this will provide better compatibility with commonly-used libraries and might avoid future bugs.
  • the implementation doesn't satisfy the user stories, I was unable to search for movies or see a list of movies in the home page. currently i see only an empty state.
  • the fetch url is incorrect, this can be improved by using a single source of truth (from constants.js, for example) and testing your code before opening a pull request.
  • there is no linter configured, which results in irregular code styles in the codebase (e.g.: both single and double quotes, uneven tab spaces, lack of semi-colons, etc...). it would also prevent other issues in your code, such as unused variables, unused functions, and empty functions.
  • there is room
@LukeberryPi
LukeberryPi / styles.css
Last active August 7, 2024 11:43
disable backdrop/background scroll when there is a modal/dialog open
/*
disable backdrop/background scroll when there is a modal/dialog open
this depends on having the open attribute on the dialog itself
more: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog
*/
dialog::backdrop { overflow: hidden; } body:has(dialog[open]) { overflow: hidden; pointer-events: none; } dialog[open] { pointer-events: auto; }
@LukeberryPi
LukeberryPi / cv.tex
Created July 1, 2024 23:14
my cv NO INFO
\documentclass[a4paper,10pt]{article}
\usepackage[margin=0.5in,nofoot]{geometry}
\usepackage{fontawesome5}
\usepackage{hyperref}
\usepackage{titlesec}
\usepackage{xcolor}
\hypersetup{
colorlinks=true,
linkcolor=blue,
@LukeberryPi
LukeberryPi / useDebounce.ts
Created June 24, 2024 15:21
simple useDebounce hook
import { useEffect, useState } from 'react';
export default function useDebounce(value: string, delay: number) {
const [debouncedValue, setDebouncedValue] = useState(value);
useEffect(() => {
const handler = setTimeout(() => {
setDebouncedValue(value);
}, delay);
@LukeberryPi
LukeberryPi / settings.json
Last active January 5, 2025 19:14
my vscode setup
{
"workbench.colorTheme": "Vesper",
"workbench.iconTheme": "chalice-icon-theme",
"editor.fontSize": 15,
"editor.fontWeight": "300",
"terminal.explorerKind": "external",
"terminal.integrated.fontSize": 20,
"terminal.integrated.fontWeight": "300",
"editor.glyphMargin": false,
"editor.fontFamily": "JetBrains Mono",
@LukeberryPi
LukeberryPi / createRange.js
Created May 29, 2024 23:06
create range javascript function
const createRange = (len, start = 1) =>
Array(len)
.fill(0)
.map((_, i) => i + start);
@LukeberryPi
LukeberryPi / index.js
Created March 9, 2024 22:01
enable copy and past on any website
javascript:(function(){
allowCopyAndPaste = function(e){
e.stopImmediatePropagation();
return true;
};
document.addEventListener('copy', allowCopyAndPaste, true);
document.addEventListener('paste', allowCopyAndPaste, true);
document.addEventListener('onpaste', allowCopyAndPaste, true);
})();
@LukeberryPi
LukeberryPi / utils.js
Last active March 5, 2024 01:32
isMobile utils
export const isTouchable = () => {
const userAgent = window.navigator.userAgent;
return (
!!userAgent && userAgent.match(/(iPad)|(iPhone)|(iPod)|(android)|(webOS)/i)
);
};
export const isIphone = () => {
return (
!!navigator.platform &&