Skip to content

Instantly share code, notes, and snippets.

View parollon's full-sized avatar
💭
Declare variables, not war

parollon

💭
Declare variables, not war
View GitHub Profile
<?php
// First we require the xml2json file of course.
require_once($modx->getOption('core_path').'components/simplx/common/xml2json.php');
// xml2json simply takes a String containing XML contents as input.
// Remember that the preprocessor always get a parameter called $dataSet
// containing the complete dataSet recieved from the dataSourceUrl or the
// dataSet Snippet parameter.
@parollon
parollon / Take_until_destroyed_Ionic_README.md
Last active May 20, 2026 06:37
takeUntilPageLeft - Patró RxJS per Ionic

takeUntilPageLeft — Patró RxJS per Ionic

Un equivalent a takeUntilDestroyed d'Angular adaptat al cicle de vida d'Ionic.


El problema

Angular proporciona takeUntilDestroyed per cancel·lar subscripcions RxJS automàticament quan un component es destrueix. Internament:

import { Injectable } from '@angular/core';
import {
Preferences,
ConfigureOptions,
GetResult,
MigrateResult,
KeysResult
} from '@capacitor/preferences';
@Injectable({
providedIn: 'root',
@parollon
parollon / Validation failed Invalid Executable.md
Last active June 17, 2025 08:47
Validation failed Invalid Executable. The executable 'Framework' contains bitcode.

Validation failed Invalid Executable. The executable 'Framework' contains bitcode.

Validation failed
Invalid Executable. The executable 'App.app/Frameworks/KontaktSDK.framework/KontaktSDK' 
contains bitcode. (ID: c749437a-d0eb-4d72-9666-65e8499303bf)

Projecte

@parollon
parollon / ESLint-Prettier.md
Created May 27, 2025 08:21
ESLint-Prettier.md

Eslint + Prettier + Ionic/Angular

npm install --save-dev eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin

npm install --save-dev @ionic/eslint-config

ESLint

.eslintrc.json

@parollon
parollon / Android User Agents.txt
Last active September 9, 2024 10:21 — forked from moomerman/ua.txt
iPad/iPhone User Agents and Android agents
Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 525) like iPhone OS 7_0_3 Mac OS X AppleWebKit/537 (KHTML, like Gecko) Mobile Safari/537
Mozilla/5.0 (Linux; U; Android 4.3; en-us; ZTE-Z667G Build/JLS36C) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
Mozilla/5.0 (Android; Linux armv7l; rv:5.0) Gecko/20110615 Firefox/5.0 Fennec/5.0
Mozilla/5.0 (Linux; Android 4.4; Nexus 5 Build/_BuildID_) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/30.0.0.0 Mobile Safari/537.36
Mozilla/5.0 (Linux; Android 4.4.2; 0PCV1 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.133 Mobile Safari/537.36
Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; GT-I9505 Build/JDQ39) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
Mozilla/5.0 (Linux; U; Android 4.1.2; en-us; GT-N8013 Build/JZO54K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Safari/534.30
Mozilla/5.0 (Linux; U; Android 4.4.2; en-us;
@parollon
parollon / dynamic-height-modal.component.html
Last active August 27, 2024 08:15
Ion-Modal dynamic height
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<ion-button (click)="dismiss()">
<ion-icon slot="icon-only" name="close-outline"></ion-icon>
</ion-button>
</ion-buttons>
<ion-title>My Modal</ion-title>
</ion-toolbar>
</ion-header>
=======================
Code:
==============================================================================================================
@ViewChild('noNumericCharsInput1', { static: true }) noNumericCharsInput1!: IonInput;
@ViewChild('noNumericCharsInput2', { static: true }) noNumericCharsInput2!: IonInput;
...
@ViewChild('noNumericCharsInputN', { static: true }) noNumericCharsInputN!: IonInput;
viewChildsInputBehaviours: Subscription[] = [];
du -h -d 1 2>/dev/null | sort -hr // mida cdels directortis
@parollon
parollon / show-hide-password.ts
Last active October 1, 2024 10:35
show hide password fuction many
<ion-input
[type]="getPasswordStatus('password1')"
>
<ion-button
(click)="showHidePassword('password1')"
fill="clear"
slot="end"
aria-label=""
>
<ion-icon