Skip to content

Instantly share code, notes, and snippets.

💭
I may be slow to respond.

Abdulrahman ☕️ abdumu

Block or report user

Report or block abdumu

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
@abdumu
abdumu / vbulletinValetDriver.php
Last active May 24, 2019
vbulletin laravel valet driver
View vbulletinValetDriver.php
<?php
class vbulletinValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
@abdumu
abdumu / phpBBValetDriver.php
Last active May 19, 2019
Laravel valet driver for phpBB
View phpBBValetDriver.php
<?php
class phpBBValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
@abdumu
abdumu / keybindings.json
Last active May 15, 2019
my vscode keybindings.json
View keybindings.json
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "cmd+enter",
"command": "editor.action.showContextMenu",
"when": "editorTextFocus"
},
{
"key": "shift+g",
"command": "workbench.view.scm"
View Modal.vue
<template>
<transition name="modal" v-if="toggled">
<div class="fixed z-50 pin-t pin-l w-full h-screen bg-grey overflow-y-scroll flex" style="background-color: rgba(0, 0, 0, .5);">
<div class="p-3 m-auto" :class="{'w-full': width!='auto'}">
<div id="modalBox" class="md:mx-auto p-4 md:p-8 bg-white border rounded border-grey-darkest shadow-lg" :class="{'w-full md:w-1/3':width === 'small', 'w-full md:w-5/6': width === 'large', 'inline-block': width === 'auto'}">
<div class="modal-header flex justify-center mb-2 text-center ">
<slot name="header"></slot>
</div>
@abdumu
abdumu / slugify.js
Last active Oct 4, 2018
Javascript function to generate a slug that `respect` Arabic.
View slugify.js
function slugify(text) {
return text.toString().toLowerCase()
.replace(/\s+/g, '-')
.replace(/[^\w\u0621-\u064A0-9-]+/g, '')
.replace(/\-\-+/g, '-')
.replace(/^-+/, '').replace(/-+$/, '');
}
@abdumu
abdumu / howTo.txt
Created Mar 17, 2018
"This connection is not private" + "Valet" + "iOS Simulator"
View howTo.txt
-1- edit ~/.composer/vendor/laravel/valet/cli/stubs/openssl.conf
Change:
basicConstraints = CA:FALSE
To:
basicConstraints = CA:TRUE,pathlen:0
save file.
@abdumu
abdumu / Cacheable.php
Created Mar 4, 2018
Cacheable Trait for Laravel Model Class for methods, request any method after adding the trait with 'Cached' as methodNameCached()
View Cacheable.php
<?php
namespace App;
use Illuminate\Support\Facades\Cache;
trait Cacheable
{
public function __call($methodName, $arguments)
@abdumu
abdumu / .post-merge
Created Feb 25, 2018
git hook (.git/hooks/.post-merge) to run a command after `git pull` for laravel by @abdu1m
View .post-merge
##
# git hook to run a command after `git pull` for laravel by @abdu1m
##
# source: https://gist.github.com/sindresorhus/7996717
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
}
@abdumu
abdumu / Laravel.Collection.drop.php
Created Dec 23, 2017
[Laravel] Drop first or last items from a collection
View Laravel.Collection.drop.php
<?php
/**
* drop the first or last {$limit} items.
*
* @param int $limit
* @return Illuminate\Support\Collection
*/
Illuminate\Support\Collection::macro('drop', function(int $limit){
if ($limit < 0) {
return $this->slice(0, $limit);
@abdumu
abdumu / Collection.loop.php
Last active Dec 23, 2017
[Laravel] Improved version of Collection->map as a macro (you can add it at AppServiceProvider.php boot method)
View Collection.loop.php
<?php
/*
* Improved version of Collection->map method
*
* @param callable $callback
*
* @return Illuminate\Support\Collection
*/
Illuminate\Support\Collection::macro('loop', function(callable $callback){
You can’t perform that action at this time.