Skip to content

Instantly share code, notes, and snippets.

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

Mostafa Kamal mostafa6765

👨‍💻
code
View GitHub Profile
@mostafa6765
mostafa6765 / laravel-cpanel-symlink.php
Last active January 9, 2021 16:36
Laravel cpanel storage symlink
@mostafa6765
mostafa6765 / node_nginx_ssl.md
Created September 24, 2020 10:50 — forked from bradtraversy/node_nginx_ssl.md
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

node node_modules/puppeteer/install.js

@mostafa6765
mostafa6765 / OrderComplete.php
Created January 26, 2020 08:04
Laravel on demand notification delay or queue
<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class OrderComplete extends Notification implements ShouldQueue
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ ^$1 [N]
@mostafa6765
mostafa6765 / 1_phpunit-api.md
Created September 27, 2019 05:24 — forked from loonies/1_phpunit-api.md
PHPUnit Cheat Sheet

PHPUnit API reference

  • version 3.6

TODO

Check those constraints:

$this-&gt;anything()
@mostafa6765
mostafa6765 / cross-origin-local-storage.js
Created August 23, 2019 19:08 — forked from buren/cross-origin-local-storage.js
Cross origin local storage sharing example (using an iframe and postMessage)
const CrossOriginLocalStorage = function(currentWindow, iframe, allowedOrigins, onMessage) {
this.allowedOrigins = allowedOrigins;
let childWindow;
// some browser (don't remember which one) throw exception when you try to access
// contentWindow for the first time, it works when you do that second time
try {
childWindow = iframe.contentWindow;
} catch(e) {
childWindow = iframe.contentWindow;
(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
@mostafa6765
mostafa6765 / Laravel Cache Clear
Created July 10, 2019 09:21 — forked from Merazsohel/Laravel Cache Clear
Laravel Cache Clear
Route::get('artisan/command/{key?}', array(function($key = null)
{
Artisan::call('config:clear');
if($key == "cache-clear")
{
try
{
echo '<br>php artisan cache:clear...';
Artisan::call('cache:clear');
@mostafa6765
mostafa6765 / editorjs.vue
Last active February 21, 2024 03:14
setup editorjs in vue. demo: https://eosbi.codesandbox.io/
<template>
<div >
<div >
<h1 style="text-align:center">This is vue editor.js <a href="https://twitter.com/@code4mk" target="_blank">@code4mk</a></h1>
</div>
<div class="editorx_body">
<!--editorjs id-->
<div class id="codex-editor"/>
</div>