Skip to content

Instantly share code, notes, and snippets.

View LukeberryPi's full-sized avatar

LukeberryPi LukeberryPi

View GitHub Profile
@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 June 20, 2024 22:51
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 &&
@LukeberryPi
LukeberryPi / settings.json
Last active March 4, 2024 20:50
my zed settings
// Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run the `open default settings` command
// from the command palette or from `Zed` application menu.
{
"features": {
@LukeberryPi
LukeberryPi / settings.json
Created March 3, 2024 06:37
vscode-settings
{
"files.autoSave": "onFocusChange",
"editor.formatOnSave": true,
"workbench.colorTheme": "Gruvbox Dark Medium",
"workbench.iconTheme": "gruvbox-material-icon-theme",
"editor.fontSize": 16,
"terminal.integrated.fontSize": 16,
"explorer.confirmDragAndDrop": false,
"editor.minimap.enabled": false,
"breadcrumbs.enabled": false,