Ddr.codesindr.codes·Feb 13, 2022 · 1 min readResolve Conflicted Files in GitCase / Problem Somehow you've got a conflicted files problem in a production environment server and you need to resolve it really quick You don't use any GUI tools that provide visual aid for git like Source Tree or VSCode to see the conflicted file...00
Ddr.codesindr.codes·Jan 31, 2022 · 1 min readLaravel Throttle using Redis to apply Rate Limit on a RequestCase / Problem You want to limit a request can made in an x times in y seconds format Solution This is an example to limit login attempt for email example@gmail.com that limited to 3 times for every 120 seconds. use Redis; ... $requestId = 'login...00
Ddr.codesindr.codes·Jan 29, 2022 · 1 min readWhen .gitignore ignoring your changesCase / Problem You want to ignore and remove already commited / pushed files, but git keep ignoring your changes on .gitignore Solution First, you must delete the index on the specified files from your git. Then add and commit the changes. git rm ...00
Ddr.codesindr.codes·Jan 29, 2022 · 1 min readHow to check if a page is loaded inside Iframe in JavascriptCase / Problem You want to treat a page loaded in iframe differently from when it's loaded normally in the body Solution Just compare the location between the parent and the iframe itself. function isInIframe() { return window.location !== window...00
Ddr.codesindr.codes·Jan 29, 2022 · 1 min readCreate new branch from stashed code in GitCase / Problem You work on new things just to realize you code on the wrong branch Solution Stash the code then create a new branch from the stash git stash git stash branch <new-branch-name> stash@{0}00