Unix shortcuts

https://linuxhandbook.com/linux-shortcuts/

trim video in multiple parts w/ for loop

In this example:
- trim a long video of 1h 
- in 60 short video
- of 1 min each
- Discard 1 second between each video.

for n in {0..60}; do start=$(($n*60 + $n)); duration=60; echo $start; ffmpeg -ss $start -i input.mov -t $duration -c copy $n.mov; done

Dynamic script import

първо си добавям един клас на цялата HTML страница, на която искам да добавя съответния скрипт и проверявам дали я има, тогава импортвам модула.
export default function UI() {
    let homePage = $('.home-wrapper')
    console.log('you are at the home page')
    if (homePage.length > 0) {
        import ( /* webpackChunkName: '/chunks/animate' */ './animate.js').then(
            module => {
                new module.default()
            },
        )
        console.log('aaaand you have just loaded your first dynamic import')
    }

    
}

Cosmos Emulator

[Troubleshoot Guide](https://azurelessons.com/azure-cosmos-db-emulator-not-working/#:~:text=Error%3A%20Multiple%20attempts%20to%20restart,%25%25LOCALAPPDATA%25%25%2C%20and%20reinstall.)

hreflang polylang hook

// define the pll_rel_hreflang_attributes callback
function filter_pll_rel_hreflang_attributes( $hreflangs ) {
	foreach ( $hreflangs as $lang => $url ) {
			if ( $lang === 'ua' ) {
					printf( '<link rel="alternate" href="%s" hreflang="%s" />' . "\n", esc_url( $url ), esc_attr( 'uk' ) );
			}
			elseif($lang == 'ru') {
				printf( '<link rel="alternate" href="%s" hreflang="%s" />' . "\n", esc_url( $url ), esc_attr( 'ru' ) );
			}
	}
	// return $hreflangs;
};

// add the filter
add

problema 404 en el servidor de wordpress

sale el error 404, de frente del servidor http, ni siquiera la pagina adornada 404del tema que hayamos configurado

editar el archivo:  
/etc/httpd/conf/httpd.conf

en las nuevas versiones de linux es el archivo:  
**/etc/apache2/apache2.conf**

se debe editar con la aplicacion NANO por que es un archivo muy protegegido y no deja tampoco con utilitarios como el winSCP,
así que el comando es:  
**sudo nano /etc/apache2/apache2.conf**  
buscar dentro la sección:  
**<Directory /var/www >**  
y all

gray color variables

$white: #ffffff;
$gray1: #F8F9FA;
$gray2: #F1F3F5;
$gray3: #E9ECEF;
$gray4: #DEE2E6;
$gray5: #CED4DA;
$gray6: #ADB5BD;
$gray7: #6A7178;
$gray8: #4F575E;
$gray9: #272B30;
$gray10: #101213;
$black: #000000;

Update AIR SDK Checklist

//mac only
xattr -d -r com.apple.quarantine ~/Development/Biofanta/Bf_15/Bf/AIRSDK_xxx

edit adt.cfg config
copy the adt.lic

//update air_home
nano ~/.zshrc

Form

import $ from 'jquery'
import gsap from 'gsap'

export default function allForms() {
    formSubmit()
    validateForm()
    filterOptions()
}

// Display errors
const validateForm = () => {
    // let errors = [...document.querySelectorAll('.error')]
    // let btnSubmit = document.querySelector('#submit-button')
    // let name = document.querySelector('#name')
    // let email = document.querySelector('#email')
    // let phone = document.querySelector('#phone')
    // let mes

ticker slider infinity

function tickerSlider() {
  let tickerSlideshows = document.querySelectorAll('.ticker-slideshow');
  console.log(tickerSlideshows)
  tickerSlideshows.forEach((element) => {
    let pauseOnHover = element.getAttribute('data-pause-on-hover');
    //
    //   Variables
    //
    //////////////////////////////////////////////////////////////////////
 
    // Play with this value to change the speed
    let tickerSpeed = 1;
 
    let tickerFlickity = null;
    let isPaused = false;
    let slideshow

Vue directive + class tooltip (4 learning)

/* https://github.com/hekigan/vue-directive-tooltip */


/*
 * @author: laurent blanes <laurent.blanes@gmail.com>
 * @tutorial: https://hekigan.github.io/vue-directive-tooltip/
 */
import Tooltip from './tooltip.js';

const BASE_CLASS = 'vue-tooltip';
const POSITIONS = ['auto', 'top', 'bottom', 'left', 'right'];
const SUB_POSITIONS = ['start', 'end'];

/**
 * usage:
 *
 * // basic usage:
 * <div v-tooltip="'my content'">
 * or
 * <div v-tooltip="{content: 'my content'}">
 *

Send email by cron

/* WP_CRON */

// add_filter('cron_schedules','cron_definer');
// function cron_definer($schedules){
//     $schedules['custominterval'] = array('interval'=> 60, 'display'=>  __('Once Every 5 Minutes')  );
//     return $schedules;
// }

add_action( 'wp', 'send_reminders_activation' );
function send_reminders_activation() {
  if ( !wp_next_scheduled( 'send_reminders_to_attendees_hook' ) ) {
    wp_schedule_event( time(), 'daily', 'send_reminders_to_attendees_hook' );
  }
}

add_action( 'send_rem

How to set the author of an image

# How to set the author name of a Docker image
There are two ways to define the authority of a docker image when you generate a new image from a dockerfile.

## Add the author label
The first, and the official one, should be the adding of the Author label in the generation process. 
To this end, you need to add the next clause, replacing the email address for one that represents your user.

```
LABEL org.opencontainers.image.authors="<domain-user>@<domain>"
```

Where the keys '<domain-user>' an

Cloud Page to de-duplicate subscriber based on Email and send Thank you email after making them subscriber for particular Campaign

This code is helpful to add new or existing subscribers to add as particular Campaign Member. We are checking based on Email Address provided whether that is already present in SF CRM or not , based on them creating a new Person Account or using an existing one. Since we cannot add Person Account directly as Campaign Member , we retrieve the PersonContactId (contactId) based on Person Account and add the same.
<script runat="server">
Platform.Load("Core","1.1.1");
try{
</script>
%%[
              
SET @Meiden = '7015J000000U64DQAS' /*campaign id */
SET @firstName = RequestParameter('firstname')
SET @middlename = RequestParameter('between')
SET @lastName = RequestParameter('lastname')
SET @email = RequestParameter('email')


/* Back-end validation */

SET @regexName = "^[a-zA-Z]+$"
SET @regexEmail = "^([\w-.+]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,24}|[0-

Switch statement

  switch(e.key) {
        case "ArrowDown":
        console.log('pressed down')
        break
        case "Up":
        console.log('pressed up')
        break
        case "Left": 
        console.log('pressed left')
        break
        case "Right":
        console.log('pressed right')
        break;
        default:
    }

Find Nearest Attribute

Instead of finding near point, this is like minpos + point function to grab nearest attribute
int prim_id;
vector prim_uv;
float dist = xyzdist(1,@P,prim_id,prim_uv);
@N = primuv(1,"N",prim_id,prim_uv);