Skip to content

Instantly share code, notes, and snippets.

View abdumu's full-sized avatar
💭
are we even real? or just entities in a simulated environment ,,,

Abdulrahman ☕️ abdumu

💭
are we even real? or just entities in a simulated environment ,,,
View GitHub Profile
@abdumu
abdumu / ExtractTranslatableStringsCommand.php
Last active January 30, 2020 16:02 — forked from robbanl/TranslateMagentoModule.php
Get translatable strings (__, @lang) for Laravel folders
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
use Illuminate\Support\Facades\File;
use SplFileInfo;
@abdumu
abdumu / app.js
Created January 10, 2020 13:26
optional helper for vue
Vue.mixin({ methods: {
optional(variable) {
return new Proxy(typeof variable === undefined || variable === null ? {} : variable, {
get(target, prop) { return prop in target ? target[prop] : null; }
});
},
}})
//usage: {{ optional(user).email }}
@abdumu
abdumu / closeall.scpt
Created July 14, 2019 03:35
Close all VSCode windows except current window (make sure terminal tab is visible)
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 June 29, 2019 16:04
production mix versioning ...
<?php
// ....
public function boot()
{
Blade::directive('mix', function ($path) {
if(! app()->environment('production')) {
return "<?=e(mix({$path}))?>";
}
@abdumu
abdumu / vbulletinValetDriver.php
Last active October 31, 2019 10:16
vbulletin laravel valet driver
<?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 October 10, 2022 18:37
Laravel valet driver for phpBB
<?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 18:20
my vscode 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"
<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 July 23, 2023 21:24
Javascript function to generate a slug that `respect` Arabic.
function slugify(text) {
return text.toString().toLowerCase()
.replace(/\s+/g, '-')
.replace(/[^\w\u0621-\u064A0-9-]+/g, '')
.replace(/\-\-+/g, '-')
.replace(/^-+/, '').replace(/-+$/, '');
}
@abdumu
abdumu / howTo.txt
Last active January 8, 2020 09:18
"This connection is not private" + "Valet" + "iOS Simulator"
-1- edit ~/.composer/vendor/laravel/valet/cli/stubs/openssl.conf
Change:
basicConstraints = CA:FALSE
To:
basicConstraints = CA:TRUE,pathlen:0
save file.