Skip to content

Instantly share code, notes, and snippets.

View Gix075's full-sized avatar

Gix075 Gix075

View GitHub Profile
@Gix075
Gix075 / indesign__apply_style_advanced.jsx
Last active December 13, 2023 18:37
InDesign Javascript code to apply a character style to all texts that match search criteria | InDesign script per assegnare uno stile di carattere a tutti i testi che corrispondono ai criteri di ricerca
var search_options = {
"styleName": "EtichettaLateraleCitta", // required (Il nome dello stile di carattere da applicare)
"fontName": "Poppins", // optional (Il nome del font da cercare)
"fontStyle": "Bold", // optional (Il nome dello stile del font da cercare)
"fontSize": 12, // optional (La dimensione del font da cercare)
"fontColor": "ColoreEuropa", // optional (Il nome del colore del font da cercare)
"searcgString": "", // optional (La stringa da cercare)
"ignoreCurrentStyle": false // optional (Se true, ignora lo stile di carattere corrente)
}
@Gix075
Gix075 / load-html-partials.js
Created July 5, 2023 09:43
HTML Partial Includes. A very simple way to include some HTML partials in a page. This script is not tinked for production site but just for html frontend layout creation.
class LoadHtmlpartials {
constructor() {
this.loadPartials();
}
loadPartials() {
document.querySelectorAll('html-partial').forEach(function(htmlPartialWrapper) {
let htmlPartialSrc = htmlPartialWrapper.getAttribute('src'),
thisCallback = htmlPartialWrapper.getAttribute('callback');
@Gix075
Gix075 / wordpress_shortcode_example.php
Created April 6, 2021 09:24
Base WordPress shortcode example. This is a little shortcode boilerplate function.
<?php
/**
* WordPress Shortcode Example
* Usage: [shortcode_example option="..."]
*/
// Shortcode Handle Function
function shortcode_example_function( $atts ) {
$a = shortcode_atts( array(
'option' => "This is the default option value" // default options array
@Gix075
Gix075 / utilities.php
Last active February 28, 2018 18:55
Very stupid but useful PHP functions
<?php
/* VERY SIMPLE UTILITIES */
/* ************************************** */
/*
* PRINT OBJECT/ARRAY
* Print and object or array inside <pre></pre> tags
*/
function printObject($object) {
echo "<pre>";
@Gix075
Gix075 / formValidator.js
Last active April 28, 2020 18:19
Form Validation
/*
Form Validator 2.1.1 by Gix075
===================================================================
This is an useful class that you can use to validate any forms.
*/
function formValidator(globOpts) {
var defaults = {
bootstrap: true,
@Gix075
Gix075 / splitString.js
Created October 29, 2015 11:07
Split each letters of "string" in span elements
function splitString(element, spanClass) {
var str = $(element).text();
str = str.split("");
var markup = "";
for (var i=0; i<str.length; i++) {
//if(str[i] == " ") str[i] = "&nbsp;"
var spanCssClass= spanClass;
if(str[i] == " ") {
spanCssClass = spanClass+"-space";
str[i] = "";
@Gix075
Gix075 / easyReadmore.js
Last active August 29, 2015 14:26
Simple collapsible text system
/*!
==============================================================
Easy Readmore - version 1.0.0
http://factory.brainleaf.eu/tools/jquery/easy-readmore
==============================================================
*/
function easyReadmore (options) {
var defaults = {
@Gix075
Gix075 / easyGMap-0.6.0.js
Last active August 29, 2015 14:16
Function for a GoogleMap in a div
/* easyGMap 0.6.0
* --------------------------------------------
* GoogleMap API and jQuery nedeed!
* This is the latest version of this tool.
* See documentation at http://factory.brainleaf.eu/tools/jquery/easy-gmap
*/
function easyGMap() {
this.getMap = function(opts) {
this.infoBoxMarkup = '<div class="easygmap_mapinfobox">'+