Skip to content

Instantly share code, notes, and snippets.

View mostafa6765's full-sized avatar
👨‍💻
code

Mostafa Kamal mostafa6765

👨‍💻
code
View GitHub Profile
@sindresorhus
sindresorhus / esm-package.md
Last active May 8, 2024 22:50
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active May 9, 2024 21:06
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

(function($) {
$(document).ready(function($) {
//hash link click
$('a[href*="#"]').on('click', function(e) {
e.preventDefault();
//console.log('hash clicked'); //uncomment this link to understand if click is working
@bradtraversy
bradtraversy / vscode_shortcuts.md
Last active May 6, 2024 12:38
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

If you have any other helpful shortcuts, feel free to add in the comments of this gist :)

Official List of all commands

@egyjs
egyjs / Direct Link of YouTube videos.md
Last active April 17, 2024 06:38
PHP API To get Direct Link of YouTube videos
@merikan
merikan / Jenkinsfile
Last active April 27, 2024 03:58
Some Jenkinsfile examples
Some Jenkinsfile examples
@justsml
justsml / fetch-api-examples.md
Last active February 24, 2024 18:05
JavaScript Fetch API Examples
@devmycloud
devmycloud / ParseInputStream.php
Last active December 6, 2023 15:22
Process php://input to get multipart/form-data parameters for PATCH API request
<?php
use Illuminate\Support\Facades\Log;
use Symfony\Component\HttpFoundation\File\UploadedFile;
/**
* stream - Handle raw input stream
*
* LICENSE: This source file is subject to version 3.01 of the GPL license
* that is available through the world-wide-web at the following URI:
@saqueib
saqueib / SimplePagination.vue
Last active December 23, 2020 03:52
VueJS pagination component to paginate anything in Laravel, checkout the tutorial on http://wp.me/p8cmxL-b7 by www.qcode.in
<template>
<div :class="{'loading': loading}" class="pager-data-wrapper">
<!-- Pagination Slot -->
<slot :result="getResult()">
<div class="text-center alert-info pb-3">
<span v-if="!loading">
{{ result.length }} items found. render it using v-for="item in result"
</span>
<span v-if="loading">