Skip to content

Instantly share code, notes, and snippets.

👨‍💻
code

Mostafa Kamal mostafa6765

👨‍💻
code
Block or report user

Report or block mostafa6765

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mostafa6765
mostafa6765 / cross-origin-local-storage.js
Created Aug 23, 2019 — forked from buren/cross-origin-local-storage.js
Cross origin local storage sharing example (using an iframe and postMessage)
View cross-origin-local-storage.js
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;
View on-click-hash-scroll-specific-div.txt
(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
View 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');
View editorjs.vue
<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>
View dynamic-middleware-laravel.php
<?php
namespace Test\Test\App\Providers;
use Illuminate\Support\ServiceProvider;
class TestServiceProvider extends ServiceProvider
{
/**
@mostafa6765
mostafa6765 / AlertSpec.js
Created Oct 19, 2018 — forked from martinlindhe/Alert.vue
jasmine + karma for vue test
View AlertSpec.js
describe("Alert component", function() {
var c = require('./../../../resources/assets/js/components/Alert.vue');
it('should have data', function () {
expect(typeof c.data).toBe('function');
});
it('should be visible', function () {
var defaultData = c.data();
@mostafa6765
mostafa6765 / karma-jasmine-webpack_karma.conf.js
Created Oct 19, 2018
js unit testing karma jasmine webpack
View karma-jasmine-webpack_karma.conf.js
// Karma configuration
// Generated on Sat Dec 16 2017 16:32:55 GMT+0600 (Bangladesh Standard Time)
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
// frameworks to use
View karma-jasmine_karma.conf.js
// karma-browserify karma.conf.js
// Karma configuration
// Generated on Sat Dec 16 2017 16:32:55 GMT+0600 (Bangladesh Standard Time)
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
View multi-auth-laravel__views-admin-layouts-app.blade.php
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
View multi-auth-laravel__views-admin-dashboard.blade.php
@extends('admin.layouts.app')
@section('content')
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading"><strong>Admin's</strong> Dashboard</div>
<div class="panel-body">
You can’t perform that action at this time.