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
<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 / 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"
@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 / 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 / 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 / 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 / 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 / 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 / git-merge-changes-of-path-from-another-branch.sh
Last active February 29, 2020 21:32
Get files from a range of commits from a different branch and merge them into your current branch
# Get files from a range of commits from a different branch
# and merge them into your current branch
#
# Imagine you are in `feature` branch, and you want
# get files [between range of commits] from `master` and merge them
# into `feature` branch.
$ git checkout master -- $(git diff --name-only SHA1 SHA1 --diff-filter=ACMRTUXB)
@abdumu
abdumu / volume.sh
Created July 2, 2020 22:09
Increase Linux audio volume to above 100% (160%) to match Windows volume boost.
#!/bin/bash
volume=$(pacmd list-sinks|grep -A 15 '* index'| awk '/volume: front/{ print $5 }' | sed 's/[%|,]//g')
command=$1;
percentage=$(( 160*20/100 ))