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 / class_decorator.ts
Created April 15, 2021 16:50 — forked from remojansen/class_decorator.ts
TypeScript Decorators Examples
function logClass(target: any) {
// save a reference to the original constructor
var original = target;
// a utility function to generate instances of a class
function construct(constructor, args) {
var c : any = function () {
return constructor.apply(this, args);
}
@mostafa6765
mostafa6765 / vue-plugin-boilerplate.js
Created April 1, 2021 18:15
develop vuejs plugin - vuejs plugin boilerplate
const MyVuePlugin = {
install(Vue, options){
//all process
}
}
if (typeof window !== 'undefined' && window.Vue) {
window.Vue.use(MyVuePlugin);
}
@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 / stacks.cpp
Last active September 29, 2019 09:38
push ,pop ,display with array c++ cpp
/******************************************************
QUEUE C++
AUTHOR URI:https://mostafa.itnishi.com
******************************************************/
#include<iostream>
#include<conio.h>
using namespace std;
int top=-1, z[5];
void push(int value)
{
@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;