Skip to content

Instantly share code, notes, and snippets.

View mkdesignn's full-sized avatar

mohammad mkdesignn

View GitHub Profile
$s3 = \Storage::disk('s3');
$client = $s3->getDriver()->getAdapter()->getClient();
$expiry = "+10 minutes";
$command = $client->getCommand('GetObject', [
'Bucket' => \Config::get('filesystems.disks.s3.bucket'),
'Key' => "file/in/s3/bucket"
]);
$request = $client->createPresignedRequest($command, $expiry);
#!/usr/bin/env bash
! ( diff -y <(grep '.\=' ./.env.example |sort |sed -e 's/=.$//') <(grep '.\=' ./.env |sort |sed -e 's/=.$//') | grep " <")
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
@mkdesignn
mkdesignn / CleanText
Last active March 1, 2020 16:36
Clean the text regex
$text = '[IMG][img]https://i.imgur.com/hyj2oZBh.png[/img][/IMG]
[IMG][img]https://i.imgur.com/removed.png[/IMG][/img]
<iframe width="640" height="360" src="https://www.youtube.com/embed/HdYg2EPMKiI?rel=0" frameborder="0" allowfullscreen></iframe>
<iframe height="560" width="40" src="https://www.youtube.com/embed/Xt2lHsDZSYs?rel=0" frameborder="0" allowfullscreen></iframe>
<iframe src="https://www.verticalscope.com/"></iframe>
This is on a 2013 70s edition. I have a video of the problem on youtube if you search. [h]Should remove code without options too[/h]. [h=1]2013 VW Beetle DAB NOT WORKING![/h]';
function cleanTheTextFirstSolution($text)
{
return preg_replace(
@mkdesignn
mkdesignn / Custom-pagination
Created May 14, 2020 19:42
Custom-pagination
protected function paginate($query)
{
$paginate = $query->paginate($this->row_per_page, null, null, $this->page);
return [$paginate->toArray(), $paginate->render()->toHtml()];
}
image: php:7.4-fpm
pipelines:
default:
# Not needed unless you're doing feature tests.
# - step:
# name: Build
# image: node:8.9.4
# caches:
# - node
# script: