Skip to content

Instantly share code, notes, and snippets.

View adamcrampton's full-sized avatar
💪
Crushing it

Adam Crampton adamcrampton

💪
Crushing it
  • Sydney, Australia
View GitHub Profile
@adamcrampton
adamcrampton / bootstrap-confirm-modal.vue
Created April 23, 2021 00:24
Bootstrap 4 confirm modal for VueJs 2
<template>
<div class="modal" id="confirmModal" tabindex="-1" aria-labelledby="confirmModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialogue-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="confirmModalLabel"><slot name="modal-header"></slot></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
@adamcrampton
adamcrampton / laravelCsvParseAndUpsert.php
Last active January 18, 2024 03:17
Laravel - Parse a CSV file, map to database columns and upsert
<?php
use Exception;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
final class CsvService {
/**
* CSV data from file into an array using the provided mappings, then insert to database.
*
@adamcrampton
adamcrampton / sendRawEmailWithAttachment.php
Last active November 12, 2024 01:02
AWS PHP SDK v3 sendRawEmail with attachment
<?php
use Aws\Ses\SesClient;
use Aws\Exception\AwsException;
/**
* Send an email using the 'raw' version of the API.
* Use this when needing to send an attachment.
*
* @param array $addresses