Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View taufik-nurrohman's full-sized avatar
🍁
I ❤ U

Taufik Nurrohman taufik-nurrohman

🍁
I ❤ U
View GitHub Profile
@taufik-nurrohman
taufik-nurrohman / php-html-css-js-minifier.php
Last active February 23, 2024 04:30
PHP Function to Minify HTML, CSS and JavaScript
<?php
// Based on <https://github.com/mecha-cms/x.minify>
namespace x\minify\_ { // start namespace
$n = __NAMESPACE__;
\define($n . "\\token_boolean", '\b(?:true|false)\b');
\define($n . "\\token_number", '-?(?:(?:\d+)?\.)?\d+');
We couldn’t find that file to show.
@taufik-nurrohman
taufik-nurrohman / arch-linux-installation-on-mbr-system.md
Created May 2, 2023 12:06 — forked from xbns/arch-linux-installation-on-mbr-system.md
Arch Linux Installation Process for a Legacy/BIOS/MBR System #arch-linux

Arch Linux Installation Process for a Legacy/BIOS/MBR System

We will tackle this process in 10 steps listed below.

I didn't want to repeat some sections well explained in the UEFI Process. You can refer there and follow due process.

Namely;

  • Connecting to WiFi.
@taufik-nurrohman
taufik-nurrohman / ckeditor5-image-upload.js
Last active February 6, 2023 17:04
Enable image upload in CKEditor 5 without using the Easy Image service.
/**
* This code is based on <https://github.com/pourquoi/ckeditor5-simple-upload>
* and will be implemented by <https://github.com/mecha-cms/extend.c-k-editor> in the future!
*/
// The upload adapter
var Adapter = function(loader, urlOrObject, t) {
var $ = this;
@taufik-nurrohman
taufik-nurrohman / simplest-markdown-parser.php
Last active December 15, 2022 12:37
The Simplest PHP Markdown Parser
<?php
/*!
* =======================================================
* Author : Taufik Nurrohman
* URL : https://github.com/taufik-nurrohman
* License : MIT
* =======================================================
*
* -- CODE: ----------------------------------------------
@taufik-nurrohman
taufik-nurrohman / toko.mysql
Last active May 25, 2022 11:47
Dummy database.
-- Tabel Daftar Transaksi
CREATE TABLE "inventory" (
"product" INTEGER, -- `product.id`
"price" INTEGER, -- Harga satuan produk
"quantity" INTEGER,
"store" INTEGER, -- `store.id`
"time" TEXT, -- Waktu terjadi transaksi
"type" INTEGER, -- Tipe transaksi
"user" INTEGER
);
@taufik-nurrohman
taufik-nurrohman / mecha.nginxconf
Last active April 23, 2022 16:01
Using Mecha under Nginx instead of Apache web server.
server {
listen 443 ssl;
root /path/to/www;
index index.php index.html;
server_name mecha-cms.com;
$(function() {
function showToast(parent, text, timeOut) {
let toast = $('<div></div>').html(text);
toast.appendTo(parent);
window.setTimeout(function() {
toast.remove();
}, timeOut);
}
$(function() {
const caption = $('.figure-caption');
const figure = $('.figure');
const image = $('.figure-img');
const input = $(':file');
input.change(function() {
caption.text(this.files[0].name);
let data = new FormData(),
$(function() {
let currentItem, currentItemID;
const addTypes = $('#add-types');
const body = $(document.body);
const confirmTarget = $('#confirm');
const confirmTrigger = $('a[data-bs-toggle="modal"][data-bs-target="#confirm"]');
const storeTypeInsert = $('#storeTypeInsert');
const storeTypeInsertText = storeTypeInsert.find('input[type=text]');