Skip to content

Instantly share code, notes, and snippets.

View ngekoding's full-sized avatar
💭
Let's make life easier!

Nur Muhammad ngekoding

💭
Let's make life easier!
View GitHub Profile
@ngekoding
ngekoding / config.js
Last active June 23, 2022 03:40
Vue + CKEditor 5 Example
// @/helpers/ckeditor.js
const advanceEditorConfig = {
toolbar: {
items: [
'heading', '|', 'fontColor', 'highlight', '|',
'bold', 'italic', 'underline', 'strikethrough', '|', 'alignment', '|', 'numberedList',
'bulletedList', '|', 'indent', 'outdent', '|', 'link', 'insertTable', '|',
'pageBreak', '|', 'undo', 'redo'
],
},
@ngekoding
ngekoding / Pdf_version_converter.php
Created July 27, 2023 03:40
PDF version converter using Ghoshscript
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
use Symfony\Component\Process\Exception\ProcessFailedException;
use Symfony\Component\Process\Process;
class Pdf_version_converter
{
private $gsPath;
private $baseCommand = '%s -sDEVICE=pdfwrite -dCompatibilityLevel=%s -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=%s %s';
@ngekoding
ngekoding / grouping-array.php
Created September 12, 2023 03:52
Grouping an array - specific case!
<?php
/**
* Grouping an array by `type` and `bank`,
* but when the `amount` is different for the same `name` (people)
* it must in another group
*/
echo '<pre>';
$array = [
@ngekoding
ngekoding / example.html
Created September 16, 2023 02:09
Iframe Document Preview with Google Docs and Ms. Office
<!-- Using Google Docs -->
<iframe
src="https://docs.google.com/gview?embedded=true&url=YOUR-FILE-URL"
style="width: 100%; height: 500px"
>
<p>Your browser is not supported.</p>
</iframe>
<!-- Using Ms. Office -->
<iframe
@ngekoding
ngekoding / last-sunday.php
Created December 14, 2023 03:20
Gets the last Sunday of the month for a given date
<?php
/**
* Gets the last Sunday of the month for a given date.
*
* @param string $dateString The input date in 'Y-m-d' format.
* @return string The last Sunday of the month in 'Y-m-d' format.
*/
function getLastSunday($dateString)
{
@ngekoding
ngekoding / Paging.php
Created April 7, 2024 10:05
CodeIgniter 3 Paging Library
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
use ChangeCase\ChangeCase;
class Paging {
private $ci;
private $qb;