Skip to content

Instantly share code, notes, and snippets.

@vluzrmos
vluzrmos / paginate.php
Created July 20, 2016 14:31
Laravel Paginate Collection or Array
<?php
/**
* Gera a paginação dos itens de um array ou collection.
*
* @param array|Collection $items
* @param int $perPage
* @param int $page
* @param array $options
*
* @return LengthAwarePaginator
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active July 25, 2024 20:36
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@earth774
earth774 / Controller.php
Created March 12, 2019 05:07
create upload image in lumen
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Laravel\Lumen\Routing\Controller as BaseController;
class Controller extends BaseController
{
public function uploadImage(Request $request)
@caovillanueva
caovillanueva / breadcrumb.tpl
Last active March 22, 2021 16:03
[PS1.7 Schema.org Rich Snippets] All snippets for Prestashop #PS17
/public_html/themes/THEME_/templates/_partials
---------------------------------------------
{if $page.page_name !='index'} <-- Just add this conditional to avoid error in index page.That's all.
<nav data-depth="{$breadcrumb.count}" class="breadcrumb hidden-sm-down">
<ol itemscope itemtype="http://schema.org/BreadcrumbList">
{block name='breadcrumb'}
{foreach from=$breadcrumb.links item=path name=breadcrumb}
{block name='breadcrumb_item'}
{if not $smarty.foreach.breadcrumb.last}
@danielstgt
danielstgt / imagick3.4.4-PHP7.4-forge.sh
Last active April 19, 2024 11:33
Install ImageMagick / Imagick 3.4.4 on PHP 7.4 server (Laravel Forge)
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
apt-get install pkg-config libmagickwand-dev -y
cd /tmp
wget https://pecl.php.net/get/imagick-3.4.4.tgz
tar xvzf imagick-3.4.4.tgz