Skip to content

Instantly share code, notes, and snippets.

View morshedx's full-sized avatar
💭
I may be slow to respond.

morshedx morshedx

💭
I may be slow to respond.
View GitHub Profile
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
@morshedx
morshedx / axios-catch-error.js
Created March 18, 2021 06:49 — forked from fgilio/axios-catch-error.js
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
@morshedx
morshedx / .eslintignore
Created November 5, 2020 10:30 — forked from remy/.eslintignore
My Next.js eslint config + `npm install --save-dev eslint eslint-plugin-react babel-eslint`
.next
out
@morshedx
morshedx / app.js
Created June 15, 2020 09:44 — forked from omarkhatibco/app.js
Counter with react-countup only when the counter in viewport
import Counter from './counter';
const App = () => (
<div className='flex flex-wrap justify-between md:justify-center'>
<Counter target={150} title='Customer' duration={1} />
<Counter target={20000} title='Rooms' duration={2} />
<Counter target={40000} title='Places' duration={3} />
<Counter target={1200000} title='Users' duration={4} />
</div>
);