Skip to content

Instantly share code, notes, and snippets.

ʿAhed ʿid Ahed91

Block or report user

Report or block Ahed91

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
View DispatchLumenJob.php
namespace App\Jobs;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Support\Facades\Mail;
Ahed91 / laravelQueueOnce1.conf
Created Sep 2, 2018
my setup Laravel queue worker
View laravelQueueOnce1.conf
command=bash -c 'sleep 5 && php artisan queue:work --once --queue=blocked'
user=ahed ; should use www-data
Ahed91 / Controller.php
Created Jul 26, 2018
select2 with laravel controller
View Controller.php
namespace App\Http\Controllers;
class CityController extends BaseController
public function getRegions()
$s = request()->get('q', '');
View app_Providers_AuthServiceProvider.php
public function boot()
Auth::viaRequest('multip-api', function ($request) {
$authorization = $request->header('Authorization');
$role = $request->header('Auth-Role');
if (!in_array($role, ['client', 'employee', 'admin', 'user'])) {
return null;
Ahed91 / check.php
Created Jun 19, 2018
check ios Alamofire api
View check.php
//Detect special conditions devices
$IOS = stripos($_SERVER['HTTP_USER_AGENT'],"iOS");
//do something with this information
if( $IOS ){
//browser reported as an iPhone/iPod touch -- do something here
Ahed91 / resize.php
Created Dec 28, 2017
image resizer php with crop and auto padding
View resize.php
// TODO create uploads/cache folder
public static function resize($path, $w, $h)
$path = ltrim($path, '/');
if (!file_exists(public_path($path))) {
$path = "uploads/placeholder.png";
Ahed91 / install_phpmyadmin.bash
Created Jul 10, 2017
Install last phpmyadmin on any linux server (Ubuntu, Debian, ....)
View install_phpmyadmin.bash
cd /var/www/html # web root
mkdir temp_dir
cd temp_dir
tar xf phpMyAdmin-4.7.2-english.tar.xz
uuidgen # this will generate unique uuid copy_it
mv phpMyAdmin-4.7.2-english/ ../uniqe_uuid
cd ..
rm -rf temp_dir/
cd uniqe_uuid/
Ahed91 / SomeController.php
Created Jun 20, 2017
Laravel Pagination with datatables server side
View SomeController.php
class SomeController extends Controller
public function anydata(Request $request)
$valid_columns = [
View Run Composer through Script
# written by
$composer_data = array(
'url' => '',
'dir' => __DIR__.'/.code',
View container_shell_Dockerfile
FROM php:5-cli
RUN apt-get update \
&& apt-get install -y \
git software-properties-common python-software-properties libicu-dev zlib1g-dev curl subversion bash \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure zip \
&& docker-php-ext-install zip \
&& docker-php-ext-configure intl \
&& docker-php-ext-install intl \
You can’t perform that action at this time.