marp |
---|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copy this file to any directory containing images & then run this script in powershell | |
# Get all png images in the current directory & convert it to webp format | |
$images = Get-ChildItem -Path (Get-Location) -Filter *.png | |
foreach ($image in $images) { | |
$fileName = $image.DirectoryName + "\" + $image.BaseName + ".webp" | |
cwebp.exe -q 80 $image.FullName -o $fileName | |
} |
Learning Rust
The following is a list of resources for learning Rust as well as tips and tricks for learning the language faster.
Warning
Rust is not C or C++ so the way your accustomed to do things in those languages might not work in Rust. The best way to learn Rust is to embrace its best practices and see where that takes you.
The generally recommended path is to start by reading the books, and doing small coding exercises until the rules around borrow checking become intuitive. Once this happens, then you can expand to more real world projects. If you find yourself struggling hard with the borrow checker, seek help. It very well could be that you're trying to solve your problem in a way that goes against how Rust wants you to work.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function replicateWithRelations(QuestionCategory $questioncategory) | |
{ | |
$newCategory = $questioncategory->replicate(); | |
$newCategory->name = "Kopyası: ".$questioncategory->name; | |
$newCategory->push(); | |
$questioncategory->relations = []; | |
//load relations on EXISTING MODEL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// For more details see: http://laraget.com/blog/implementing-infinite-scroll-pagination-using-laravel-and-jscroll | |
namespace App\Http\Controllers\InfiniteScrolling; | |
use App\Comment; | |
use Illuminate\Http\Request; | |
use App\Http\Requests; | |
use App\Http\Controllers\Controller; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new ol.layer.Tile({ | |
type: 'base', | |
title: 'ESRI world imagery', | |
visible: false, | |
source: new ol.source.XYZ({ | |
attributions: [ | |
new ol.Attribution({ | |
html: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community' | |
}) | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
NewerOlder