Skip to content

Instantly share code, notes, and snippets.

View josanua's full-sized avatar
🎯
Focusing

Andrew josanua

🎯
Focusing
View GitHub Profile
@josanua
josanua / script.js
Last active December 7, 2023 09:55
js scripts
// Load DOM Basic usage
window.addEventListener('DOMContentLoaded', (event) => {
console.log('DOM fully loaded and parsed');
});
// Window Location
window.location.href // returns the href (URL) of the current page
window.location.hostname // returns the domain name of the web host
@josanua
josanua / index.html
Last active April 23, 2020 10:29
blank_html
<!-- BS4 -->
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
@josanua
josanua / wp-helper.php
Last active January 25, 2024 23:54
wordpress helper file
<?php
/************ Global Variables and settings ************/
// for external file to include WP environment
require( '../sitename-base/wp-load.php' );
// Global Var
// https://codex.wordpress.org/Global_Variables
@josanua
josanua / jQuery.js
Last active April 1, 2024 10:18
jQuery
http://jquery.com/
// Inlude and Test if jQuery Work
http://learn.jquery.com/using-jquery-core/document-ready/
http://learn.jquery.com/using-jquery-core/avoid-conflicts-other-libraries/
3.x:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
2.x:
@josanua
josanua / ajax.js
Last active April 28, 2021 16:04
ajax jquery
https://www.w3schools.com/jquery/jquery_ref_ajax.asp
Method Description
// jQuery
$.ajax() Performs an async AJAX request
$.ajaxPrefilter() Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax()
$.ajaxSetup() Sets the default values for future AJAX requests
$.ajaxTransport() Creates an object that handles the actual transmission of Ajax data
$.get() Loads data from a server using an AJAX HTTP GET request
$.getJSON() Loads JSON-encoded data from a server using a HTTP GET request
$.parseJSON() - ! Deprecated in version 3.0, use JSON.parse() instead, it's Vanilla JS. Takes a well-formed JSON string and returns the resulting JavaScript value
@josanua
josanua / wp-plugins.txt
Last active January 25, 2024 23:54
wp plugins
----------------------- Must have/new projects -------------------------
Check Email
Query Monitor
Show Current Template
Theme Check (nu mereu, doar sa verific thema dupa standard)
----------------------- Widgets -------------------------
Widgets / General ( widget settings )
- WooSidebar - widget config
@josanua
josanua / phphelper.php
Last active May 18, 2024 15:13
PHP Helper
<?php
PHP: Hypertext Preprocessor (PHP)
Server side programming language
// Code style
https://gist.github.com/jesseschalken/0f47a2b5a738ced9c845
// TODO: de citit
https://www.codementor.io/@veenitchauhan/basics-of-naming-conventions-for-php-developers-eliexmew6
@josanua
josanua / front-end.html
Last active December 15, 2023 09:04
Front End Helper
<!-- Util links -->
Font-awesome v.5: https://kit.fontawesome.com/a076d05399.js
Meta tags
<!-- For bootstrap -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- To prevent Mobile Safari from automatically detecting phone numbers, add the following meta tag to the top of the page: -->
<meta name="format-detection" content="telephone=no">
@josanua
josanua / css-helper.css
Last active September 5, 2023 08:35
css-helper
/* Css Helper */
/* Connect CSS */
<link rel="stylesheet"href="style.css">
<!-- Browser suffixes -->
Chrome -chrome-
Safari -webkit-
Mozilla -moz-
@josanua
josanua / wp-code-utils.php
Last active April 16, 2024 12:49
wp code utils
<?php
************ Debug, Debuging ************
//Activate log files in wp-config.php
define( 'WP_DEBUG', true ); // Enabling WP_DEBUG will cause all PHP errors, notices and warnings to be displayed.
define( 'WP_DEBUG_LOG', true ); // Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_DISPLAY', true ); // Controls whether debug messages are shown inside the HTML of pages or not.
// use this
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );