Skip to content

Instantly share code, notes, and snippets.

View heshamelmasry77's full-sized avatar
🦆
Coding

Hesham El Masry heshamelmasry77

🦆
Coding
View GitHub Profile
@juliencrn
juliencrn / gitignore.sh
Created May 30, 2019 13:37
Remove .idea files from PHPStorm with git & .gitignore
# Remove the file from the repository
git rm --cached .idea/
# now update your gitignore file to ignore this folder
echo '.idea' >> .gitignore
# add the .gitignore file
git add .gitignore
git commit -m "Removed .idea files"
@a-barbieri
a-barbieri / README.md
Last active June 6, 2021 21:48
NextJS sitemap generator with dynamic URL

NextJS sitemap generator

Install

The current setup has been tested on Next Js 7.0.0.

You need to install Axios.

$ npm install axios
@kt2763
kt2763 / nuxtjs-pagination-component.vue
Created November 24, 2017 21:35
Nuxt.js Pagination
<template>
<nav id="pagination">
<ul class="page-numbers" v-if="$store.state.totalPageCount">
<li v-for="num in this.pageNumbers" v-if="num != null" v-bind:style="{ width: (100 / pageNumberCount) + '%' }">
<nuxt-link v-if="num != $route.query.page && num != currentPage" :to="{ path: '/', query: { page: num } }">{{ num }}</nuxt-link>
<span v-else>{{ num }}</span>
</li>
</ul>
<ul class="page-guides" v-if="this.$store.state.totalPageCount != 1">
<li>
@wesbos
wesbos / async-await.js
Created February 22, 2017 14:02
Simple Async/Await Example
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
});
}
@rap2hpoutre
rap2hpoutre / gup-to-webpack.md
Last active November 22, 2023 00:30
Laravel 5.4: migrate from gulp to webpack
  • Create a webpack.mix.js file in root directory:
const { mix } = require('laravel-mix');

mix.js('resources/assets/js/app.js', 'public/js')
  .sass('resources/assets/sass/app.scss', 'public/css');
  
/* Optional: uncomment for bootstrap fonts */
// mix.copy('node_modules/bootstrap-sass/assets/fonts/bootstrap/','public/fonts/bootstrap');
@manjeettahkur
manjeettahkur / kata01.js
Last active February 10, 2024 08:20
Given the triangle of consecutive odd numbers
Description:
Given the triangle of consecutive odd numbers:
1
3 5
7 9 11
13 15 17 19
21 23 25 27 29
...
@jonleighton
jonleighton / base64ArrayBuffer.js
Last active April 19, 2024 21:54
Encode an ArrayBuffer as a base64 string
// Converts an ArrayBuffer directly to base64, without any intermediate 'convert to string then
// use window.btoa' step. According to my tests, this appears to be a faster approach:
// http://jsperf.com/encoding-xhr-image-data/5
/*
MIT LICENSE
Copyright 2011 Jon Leighton
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: