Skip to content

Instantly share code, notes, and snippets.

View bagassenop's full-sized avatar

Bagas Seno bagassenop

  • PT. JFE Steel Galvanizing Indonesia
  • Bekasi
  • 13:12 (UTC +07:00)
View GitHub Profile
@bagassenop
bagassenop / gist:c155e35ec3125bd0e58c1f6ee45a49db
Created April 16, 2026 04:06
Looping and Image appending to Excel
$pictureCoordinates = ['A30', 'H30'];
$tempPicturePaths = [];
$attachments = $activity?->attachments ?? collect();
foreach ($attachments->slice(0, 2) as $index => $attachment) {
$pictureFile = $attachment->attachment_path;
$picturePath = rtrim($this->storagePath, '/') . '/Attachments/Problem Pictures/' . $pictureFile;
if (!Storage::disk('share')->exists($picturePath)) {
continue;
@bagassenop
bagassenop / convert.ps1
Last active January 26, 2026 01:32
PowerShell Script to convert pptx file to pdf
# Get folders on the same path of this script
$currentFolder = $PSScriptRoot
# Start PowerPoint in the background
$pptApp = New-Object -ComObject PowerPoint.Application
# PowerPoint must be visible for some versions to work, but we will minimize interaction
$pptApp.Visible = [Microsoft.Office.Core.MsoTriState]::msoTrue
Write-Host "Searching for PPTX files in: $currentFolder" -ForegroundColor Cyan