Skip to content

Instantly share code, notes, and snippets.

💭
I may be slow to respond.

Abdulrahman ☕️ abdumu

💭
I may be slow to respond.
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 / closeall.scpt
Created Jul 14, 2019
Close all VSCode windows except current window (make sure terminal tab is visible)
View closeall.scpt
tell application "System Events"
tell process "Code"
repeat while window 2 exists
click button 1 of window 2
end repeat
end tell
end tell
@abdumu
abdumu / AppServiceProvider.php
Created Jun 29, 2019
production mix versioning ...
View AppServiceProvider.php
<?php
// ....
public function boot()
{
Blade::directive('mix', function ($path) {
if(! app()->environment('production')) {
return "<?=e(mix({$path}))?>";
}
@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"
}
You can’t perform that action at this time.