Skip to content

Instantly share code, notes, and snippets.

View Lasyanga's full-sized avatar
🎯
Focusing

Herminigildo Jr Quiano Lasyanga

🎯
Focusing
View GitHub Profile
@Lasyanga
Lasyanga / helper.sql
Last active January 23, 2025 06:09
common helper dealing with sql
-- finding the not existed on the other db.table --
SET @tblname = "table_name";
SET @dbname_a = "A";
SET @dbname_b = "B";
SELECT
CONCAT(
'ALTER TABLE ', a.TABLE_NAME, ' ADD `', a.COLUMN_NAME, '` ', a.COLUMN_TYPE,
IFNULL(CONCAT(' DEFAULT ', a.COLUMN_DEFAULT), ''), ';'
) as alter_statement
FROM
@Lasyanga
Lasyanga / web_resources.js
Last active May 26, 2023 11:27
Get all resources that was used in the webpage.
// Function to retrieve all resources used in the webpage
function getResources() {
// Get performance entries
const entries = performance.getEntriesByType('resource');
// Map the entries to extract resource names
const resources = entries.map(entry => entry.name);
return resources;
}
@Lasyanga
Lasyanga / devtools-detect.js
Created March 9, 2023 15:53 — forked from oussamahamdaoui/devtools-backend.ts
Detect devtools open and close events tested on Chrome and Safari
(function() {
'use strict';
const el = new Image();
let consoleIsOpen = false;
let consoleOpened = false;
Object.defineProperty(el, 'id', {
get: () => {
consoleIsOpen = true;
}
@Lasyanga
Lasyanga / build4123.sublime4.key
Created September 18, 2022 04:24 — forked from skoqaq/build4123.sublime4.key
Sublime Text 4 License Key
—– BEGIN LICENSE —–
Mifeng User
Single User License
EA7E-1184812
C0DAA9CD 6BE825B5 FF935692 1750523A
EDF59D3F A3BD6C96 F8D33866 3F1CCCEA
1C25BE4D 25B1C4CC 5110C20E 5246CC42
D232C83B C99CCC42 0E32890C B6CBF018
B1D4C178 2F9DDB16 ABAA74E5 95304BEF
9D0CCFA9 8AF8F8E2 1E0A955E 4771A576
@Lasyanga
Lasyanga / stringEncryption.php
Created June 8, 2022 12:20 — forked from fosron/stringEncryption.php
Modern method to encrypt/decrypt a string in PHP
<?php
/**
* Simple string encryption/decryption function.
* CHANGE $secret_key and $secret_iv !!!
**/
function stringEncryption($action, $string){
$output = false;
$encrypt_method = 'AES-256-CBC'; // Default
@Lasyanga
Lasyanga / SplClassLoader.php
Created June 6, 2022 05:47 — forked from jwage/SplClassLoader.php
Add MIT license.
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,