Skip to content

Instantly share code, notes, and snippets.

View greatsami's full-sized avatar

Sami Mansour greatsami

View GitHub Profile
@greatsami
greatsami / gist:f6f667208d9858dff6269932b0ea9bbf
Created September 1, 2023 11:18
Aliases for laravel & sail & docker
## edit .zshrc
## sudo nano ~/.zshrc
## Add these lines at the bottom of file
## save and exit
## run command (source ~/.zshrc)
alias sail='[ -f sail ] && sh sail || sh vendor/bin/sail'
alias sa='sail artisan'
alias samod="sail artisan make:model"
@greatsami
greatsami / Support Arabic in dompdf.txt
Last active April 26, 2020 21:06
Support Arabic in dompdf
Solution From https://github.com/dompdf/dompdf/issues/712#issuecomment-492469206
I 'm working with symfony and I found finally a solution to my example with mixed french and arabic language in table with dompdf
in the project make command :
composer require ar-php/ar-php
open the file Glyphs.php in the follow path :
After Setup laravel websockets with port 6003 and letsencrypt certs on ubuntu 18.4 LTS.
Note: change domain.test with your domain
edit .env
```
PUSHER_APP_ID=myId
PUSHER_APP_KEY=myKey
PUSHER_APP_SECRET=mySecret
PUSHER_APP_CLUSTER=eu
<!DOCTYPE html>
<html>
<head>
<title>Be right back.</title>
<link href="https://fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css">
<style>
html, body {
class CheckSiteStatus
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
@greatsami
greatsami / gist:39bed74be1fd566e84dd3fd4ad22e678
Created August 10, 2018 10:59
Print limited words from paragraph
<?php
function word_limiter($str, $limit = 100, $end_char = '&#8230;'){
$str2 = strip_tags($str);
//$str2 = $str;
if (trim($str2) == ''){
return $str2;
}
preg_match('/^\s*+(?:\S++\s*+){1,'.(int) $limit.'}/', $str2, $matches);
if (strlen($str2) == strlen($matches[0])){
$end_char = '';