This file contains hidden or 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
var imageStatus = document.getElementById('my-file-input'); | |
// imageStatus = input[type="file"] | |
if (files[0].size > fileMaxSize) { | |
imageStatus.innerText = 'Datoteka ne sme biti večja od 5MB!'; | |
imageUpload.value = ''; | |
var imageUploadClone = imageUpload.cloneNode(true); | |
imageUpload.parentNode.replaceChild(imageUploadClone, imageUpload); | |
} |
This file contains hidden or 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
class User extends Model | |
{ | |
public static function boot() | |
{ | |
parent::boot(); | |
self::creating(function($model){ | |
// ... code here | |
}); |
This file contains hidden or 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
shopt -s nullglob | |
for i in *.png; do | |
echo "Resizing $i" | |
FILE=$i | |
FILENAME="${FILE%%.*}" | |
EXT="${FILE##*.}" | |
convert $FILE -resize 270x "./resized/${FILENAME}-270.${EXT}" | |
convert $FILE -resize 320x "./resized/${FILENAME}-320.${EXT}" | |
convert $FILE -resize 560x "./resized/${FILENAME}-560.${EXT}" | |
convert $FILE -resize 800x "./resized/${FILENAME}-800.${EXT}" |
This file contains hidden or 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
const loadBackgroundImage = (element) => { | |
if (typeof element.dataset.src === 'undefined') { return } | |
const src = element.dataset.src | |
element.style.backgroundImage = `url(${src})` | |
element.removeAttribute('data-src') | |
} | |
const handleIntersection = (entries, observer) => { | |
for(let i = 0; i < entries.length; ++i) { | |
loadBackgroundImage(entries[i].target) |
This file contains hidden or 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
git tag -d tag-name | |
git push origin :refs/tags/tag-name | |
This file contains hidden or 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 | |
$iccProfile = '../path_to_icc/Profile.icc'; | |
$image = new Imagick(); | |
$image->clear(); | |
$image->readImage($imagePath); | |
if ($image->getImageColorspace() == Imagick::COLORSPACE_CMYK) { | |
return; | |
} | |
$iccCmyk = file_get_contents($iccProfile); |
This file contains hidden or 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
@import url("~fullcalendar/dist/fullcalendar.min.css"); |
This file contains hidden or 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 | |
// thanks to: https://stevenwestmoreland.com/2017/03/recording-last-login-information-using-laravel-events.html | |
<?php | |
namespace App\Providers; | |
use Illuminate\Support\Facades\Event; | |
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; |
This file contains hidden or 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
app.activeDocument.sections[0].continueNumbering = false; | |
app.activeDocument.sections[0].pageNumberStart = 5; |