Skip to content

Instantly share code, notes, and snippets.

View totoprayogo1916's full-sized avatar
🏁
🤣😂🙄😅😗

Toto totoprayogo1916

🏁
🤣😂🙄😅😗
  • Special Region of Yogyakarta, ID
View GitHub Profile
@totoprayogo1916
totoprayogo1916 / template.xml
Last active September 23, 2023 23:27
Blogger Template with Bootstrap v5 Starter
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<html b:css='false' b:js='false' xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'>
<head>
<!-- Required meta tags -->
<meta charset='utf-8'/>
<meta content='width=device-width, initial-scale=1' name='viewport'/>
<title><data:view.title.escaped/></title>
@totoprayogo1916
totoprayogo1916 / customPagination.php
Last active January 10, 2024 08:36
Codeigniter 4 Pagination (manual setting $limit & $offset)
$page = (int) $this->request->getGet('page'); //
$limit = config('Pager')->perPage; // see Config/Pager.php
if (!isset($page) || $page === 0 || $page === 1) {
$page = 1;
$offset = 0;
} else {
$offset = ($page - 1) * $limit;
$page = $page;
}
@totoprayogo1916
totoprayogo1916 / settings.json
Created October 16, 2020 17:55
[MY] VS Code settings
{
"compile-hero.typescript-output-toggle": false,
"diffEditor.maxComputationTime": 0,
"editor.multiCursorModifier": "ctrlCmd",
"git.autofetch": true,
"git.confirmSync": false,
"git.enableCommitSigning": true,
"json.schemaDownload.enable": false,
"php.validate.executablePath": "",
"window.menuBarVisibility": "toggle",
/**
* Usage:
* makeRequest("GET", "URL_GET_JSON", { postId: 1})
* .then(data => {
* console.log(data);
* });
*/
function makeRequest(method, url, qs_params) {
return new Promise((resolve, reject) => {
@totoprayogo1916
totoprayogo1916 / functions.php
Created August 9, 2021 03:09
defer script js - wordpress
<?php
function defer_scripts( $tag, $handle, $src ) {
$defer = array(
'my-js'
);
if ( in_array( $handle, $defer ) ) {
return '<script defer src="' . $src . '" type="text/javascript"></script>';
}
@totoprayogo1916
totoprayogo1916 / youtube_id_regex.php
Last active December 1, 2021 04:34 — forked from ghalusa/youtube_id_regex.php
Extract the YouTube Video ID from a URL in PHP
<?php
// Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored)
// http://youtu.be/dQw4w9WgXcQ
// http://www.youtube.com/embed/dQw4w9WgXcQ
// http://www.youtube.com/watch?v=dQw4w9WgXcQ
// http://www.youtube.com/?v=dQw4w9WgXcQ
// http://www.youtube.com/v/dQw4w9WgXcQ
// http://www.youtube.com/e/dQw4w9WgXcQ
// http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ
@totoprayogo1916
totoprayogo1916 / createTable.js
Created February 1, 2022 04:46
create table (vanilla JS)
var placeTable = document.getElementById('tableDetail')
// clean placeTable
placeTable.innerHTML = ''
// (C1) CREATE EMPTY TABLE
var table = document.createElement("table"),
row, cellA, cellB;
table.classList.add('table', 'table-bordered')
@totoprayogo1916
totoprayogo1916 / app-Config-Eloquent.php
Last active September 2, 2022 02:28
illuminate/eloquent setting for CodeIgniter4
<?php
// app/Config/Eloquent.php
namespace Config;
use Illuminate\Database\Capsule\Manager as Capsule;
class Eloquent
{
{
"version": "0.2.0",
"configurations": [
{
"name": "Spark Serve",
"type": "php",
"request": "launch",
"program": "${workspaceFolder}/spark",
"cwd": "${workspaceRoot}",
"args": ["serve", "-port", "4562" ],
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<add value="index.php" />
</files>
</defaultDocument>
</system.webServer>
</configuration>