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 | |
function rotate_jpg($filename) | |
{ | |
if (exif_imagetype($filename) == IMAGETYPE_JPEG) | |
{ | |
$image = imagecreatefromjpeg($filename); | |
$image = imagerotate($image, array_values([0, 0, 0, 180, 0, 0, -90, 0, 90])[@exif_read_data($filename)['Orientation'] ?: 0], 0); | |
imagejpeg($image, $filename, 100); | |
} |
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
$tooltip-border-color: #ccc; | |
$tooltip-border-width: 1px; | |
$tooltip-arrow-border-width: $tooltip-arrow-width + $tooltip-border-width; | |
.tooltip { | |
&.top { padding: $tooltip-arrow-border-width 0; } | |
&.right { padding: 0 $tooltip-arrow-border-width; } | |
&.bottom { padding: $tooltip-arrow-border-width 0; } | |
&.left { padding: 0 $tooltip-arrow-border-width; } | |
} |
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
SELECT * FROM media | |
LEFT JOIN media_priority | |
ON (media_priority.media_id = media.id AND media_priority.media_tag = '".$tag."') | |
WHERE something = 'something' | |
ORDER BY (media_priority.media_order IS NULL) ASC, media_priority.media_order ASC; |
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
function getFilePathAttribute($value) | |
{ | |
$disk = Storage::disk('s3'); | |
if ($disk->exists($value)) { | |
$command = $disk->getDriver()->getAdapter()->getClient()->getCommand('GetObject', [ | |
'Bucket' => Config::get('filesystems.disks.s3.bucket'), | |
'Key' => $value, | |
]); |