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
import { S3Client } from "@aws-sdk/client-s3"; | |
import { Upload } from "@aws-sdk/lib-storage"; | |
const parallelUploads3 = new Upload({ | |
client: new S3Client({ | |
region: "ap-southeast-2", | |
credentials: { | |
accessKeyId: props.accessKeyID, | |
secretAccessKey: props.secretKey, | |
}, |
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
<script setup> | |
import Pagination from "laravel-vue-pagination"; | |
defineProps({ | |
data: { | |
type: Object, | |
required: true, | |
}, | |
getter: { | |
type: Function, | |
required: true, |
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
//It is important to add the origin to the AllowedOrigins on your backend. Avoid using wildcard like '*' - chances it will not work. | |
function forceDownload(url, fileName) { | |
const xhr = new XMLHttpRequest(); | |
xhr.open("GET", url, true); | |
xhr.setRequestHeader("Access-Control-Allow-Origin", "*"); | |
xhr.responseType = "blob"; | |
xhr.onload = function () { | |
const urlCreator = window.URL || window.webkitURL; | |
const imageUrl = urlCreator.createObjectURL(this.response); | |
const tag = document.createElement("a"); |
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
using namespace System.Management.Automation | |
using namespace System.Management.Automation.Language | |
# Alias | |
function get-gitstatus { | |
git status $args | |
} | |
function get-gitcommit { | |
git commit -am $args | |
} |
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
//Use this to your reactive data/state. | |
function debounce(Callback, delay = 500) { | |
if (typeof window.DEBOUNCER !== 'undefined') { | |
clearTimeout(window.DEBOUNCER); | |
} | |
window.DEBOUNCER = setTimeout(() => { | |
Callback(); | |
}, 500); |
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 | |
private function searchConcats($query, $search) | |
{ | |
$query->orWhere(DB::raw('CONCAT(registrants.student_year,"-",LPAD(registrants.student_no,4,0))'), "LIKE", "%" . $search . "%"); | |
$query->orWhere(DB::raw('CONCAT(registrants.first_name," ",registrants.last_name)'), "LIKE", "%" . $search . "%"); | |
$query->orWhere(DB::raw('CONCAT(registrants.last_name," ",registrants.first_name)'), "LIKE", "%" . $search . "%"); | |
} | |
public function index(Request $request) { |