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 / email-input.html
Last active July 28, 2023 07:06
Pattern / regex for email input form
<input type="email" name="email" value="" autocomplete="off" class="form-material-input" id="email" pattern="((?!\.)[\w\-_+.]*[^.])(@\w+)(\.\w+(\.\w+)?[^.\W])" required>
@totoprayogo1916
totoprayogo1916 / command
Last active December 25, 2022 03:11
CodeIgniter4 :: Create a symlink on the WRITABLE (upload) directory for public
**WINDOWS**
mklink /D "D:\project\public\uploads" "D:\project\writable\uploads"
**LINUX**
ln -s ~/project/writable/uploads ~/project/public/uploads
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<add value="index.php" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
{
"version": "0.2.0",
"configurations": [
{
"name": "Spark Serve",
"type": "php",
"request": "launch",
"program": "${workspaceFolder}/spark",
"cwd": "${workspaceRoot}",
"args": ["serve", "-port", "4562" ],
@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
{
@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 / 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 / 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>';
}
/**
* 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 / 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",