Classes Names Calculation in Loop

**Four Classes Loop**

```php
<?php
$count = 1;
$lap = 1;
foreach($slider as $key => $slide):
	$unique_id = str_replace( ' ', '-', strtolower( $slide['tab_title'] ) ) . '-' . $key;
	$class_name = '';
	$first_class = 4 * $lap - 3;
	$second_class = 2 * (2 * $lap - 1);
	$third_class = 4 * $lap - 1;
	$fourth_class = 4 * $lap;
	$lap = ($count % 4 == 0 ? ++$lap : $lap);
	if($count == $first_class){
		$class_name = 'nav-blue';
	}elseif($count == $second_class){
		$class_name = 'nav-red';
	}elseif($count == $third_class){
		$class_name = 'nav-yellow';
	}elseif($count == $fourth_class){
		$class_name = 'nav-dblue';
	}
	?>
	<li class="nav-item">
		<a class="nav-link <?php echo $class_name; ?> <?php echo $key == 0 ? 'active' : ''; ?>" id="tab-<?php echo $key; ?>" data-toggle="tab" href="#tab-content-<?php echo $key; ?>" role="tab" aria-controls="<?php echo $unique_id; ?>" aria-selected="<?php echo $key == 0 ? 'true' : 'false'; ?>"><i class="tab-icon" style="background:<?php echo $slide['tab_color

Positioning of Riskalyze button

Will need to remove "show-for-medium" class through jQuery if necessary.
/* Riskalyze */
.riskalyze {
    margin-top: 1.5rem;
}
.riskalyze #riskalyze-btn-container {
    text-align: right;
}
@media screen and (min-width: 64em) {
    .aw-header--sticky.aw-header__sticky.sticky .cell.navbar-menu-block > div > .cell:first-child {
        margin-bottom: 1.5rem;
    }
}
@media screen and (max-width: 63.9375em) {
    .aw-header--sticky.aw-header__sticky.sticky .cell.logo-section {
        z-index: 9;
    }
}
@media screen and (min-width: 40em) and (max-width: 63.9375em) {
    .aw-header--sticky.aw-header__sticky.sticky .cell.navbar-menu-block > div > .cell:first-child {
        margin-bottom: 0;
    }
    .riskalyze {
        margin-top: -5.6rem;;
    }
    .riskalyze #riskalyze-btn-container > a.rsk-btn-lt.rsk-btn-lg.rsk-btn-logo {
        margin-right: 1.4rem;
    }
}
@media screen and (max-width: 39.9375em) {
    .riskalyze {
        margin-top: -3rem;
    }
    .riskalyze div {
        background: transparent;
    }
    .riskalyze #riskalyze-btn-container > a

Tabs with Icons

<!-- https://digitalauthorship.com/startui/tabs.html -->
			
			<section class="tabs-section">
				<div class="tabs-section-nav tabs-section-nav-icons">
					<div class="tbl">
						<ul class="nav" role="tablist">
							<li class="nav-item">
								<a class="nav-link active" href="#tabs-1-tab-1" role="tab" data-toggle="tab">
									<span class="nav-link-in">
										<i class="font-icon font-icon-cogwheel"></i>
										Settings
									</span>
								</a>
							</li>
							<li class="nav-item">
								<a class="nav-link" href="#tabs-1-tab-2" role="tab" data-toggle="tab">
									<span class="nav-link-in">
										<span class="glyphicon glyphicon-music"></span>
										Contacts
									</span>
								</a>
							</li>
							<li class="nav-item">
								<a class="nav-link" href="#tabs-1-tab-3" role="tab" data-toggle="tab">
									<span class="nav-link-in">
										<i class="fa fa-product-hunt"></i>
										Gateway
									</span>
		

pubsub python

from google.cloud import pubsub_v1
import datetime
import json
import sensordata
import time
 
project_id = "<your prject id&gt;" # enter your project id here
topic_name = "<topic name&gt;" # enter the name of the topic that you created
 
publisher = pubsub_v1.PublisherClient()
topic_path = publisher.topic_path(project_id, topic_name)
 
futures = dict()
 
def get_callback(f, data):
    def callback(f):
        try:
            # print(f.result())
            futures.pop(data)
        except:
            print("Please handle {} for {}.".format(f.exception(), data))
 
    return callback
 
while True:
    time.sleep(3)
    distance = round(float(sensordata.FindDistance()),2)
    timenow = float(time.time())
    # timenow = datetime.datetime.now()
    data = {"time":timenow, "distance" : distance}
    print(data)
    # When you publish a message, the client returns a future.
    future = publisher.publish(
        topic_path, data=(json.dumps(data)).encode("utf-8")) # data must be a bytes

email template and push data

-- generic send email
procedure send_email (in_email_body   in varchar2,
                      in_to           in varchar2,
                      in_from         in varchar2 default gk_default_return_email,
                      in_subj         in varchar2
                     ) as
                     
                     
begin

  apex_mail.send(p_to   => in_to,        
                 p_from => in_from, 
                 p_subj => in_subj,
                 p_body => in_email_body;

  apex_mail.push_queue;  

end send_email;

Mount disk in Linux

sudo apt-get clean            #  to get some space
apt install cloud-guest-utils # tool to mount blocks
lsblk                         # to list all blocks
growpart /dev/xvda 1          # to extend size of specific block(here xvda 1)
resize2fs /dev/xvda1          # mount block
df -h                         # check file system

input-toggle

input toggle
<div class="input-group">
                        <div class="toggle">
                          <div class="toggle-left link">
                            <label for="input-date-end">
                              Terminar task automáticamente en su “Fecha de fin”
                            </label>
                          </div>
                          <div class="toggle-switch">
                            <input id="input-date-end" class="check" type="checkbox" name="switch">
                            <div class="inside"></div>
                            <div class="background"></div>
                          </div>
                        </div>
                      </div>

Bootstrap Breadcrumb

				<ol class="breadcrumb">
					<li><a href="#">Home</a></li>
					<li><a href="#">Library</a></li>
					<li class="active">Data</li>
				</ol>

input-date-w-icon

input date with icon at right
<div class="col-6 pt-15 d-flex">
                                                    <div class="input-group floating-label">
                                                        <input class="btr-radius-0 bbr-radius-0" type="text" name="horario" id="usuario-horario" />
                                                        <label class="input-label-small" for="usuario-horario">Horario</label>
                                                        <div class="invalid-feedback">
                                                            Ingresa un horario valido.
                                                        </div>
                                                    </div>
                                                    <div class="input-group-append d-inline-block">
                                                        <span class="input-group-text btl-radius-0 bbl-radius-0">
                                                            <label for="usuario-horario">

Navigation styling when background is coloured

[data-block-internal-id="aw_core_visitormainmenu"] .is-dropdown-submenu {
    background-color: var(--primary-color);
}
@media screen and (min-width: 64em) {
    [data-block-internal-id="aw_core_visitormainmenu"] .menu-item.is-dropdown-submenu-item > a, [data-block-internal-id="aw_core_visitormainmenu"] .menu-item.is-dropdown-submenu-item > a.is-active, [data-block-internal-id="aw_core_visitormainmenu"] .menu .is-submenu-parent-item > a.is-active {
        color: #FFFFFF;
    }
    [data-block-internal-id="aw_core_visitormainmenu"] .menu-item.is-dropdown-submenu-item > a:hover, [data-block-internal-id="aw_core_visitormainmenu"] .menu-item.is-dropdown-submenu-item > a.is-active:hover, [data-block-internal-id="aw_core_visitormainmenu"] .menu .is-submenu-parent-item > a.is-active:hover {
        color: #CCCCCC;
    }
}

AuthManagerBuilder.java

@Autowired
	public void configureAuthentication(AuthenticationManagerBuilder authManagerBuilder) throws Exception {
		authManagerBuilder
			.userDetailsService(this.userDetailsService)
			.passwordEncoder(passwordEncoder());
	}

AuthenticationManager stacktrace

org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.security.authentication.AuthenticationManager' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1716) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1272) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1226) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(Autowired

remove_environmental_variable

# source: https://stackoverflow.com/questions/13222724/command-line-to-remove-an-environment-variable-from-the-os-level-configuration  
## content:  
this tells how to delete an environmental variable in windows without rebooting.

Change PayPal logo on Checkout Page

add_filter( 'woocommerce_paypal_icon', 'bbloomer_replace_paypal_icon' );
  
function bbloomer_replace_paypal_icon() {
   return 'https://your_image_url';
}

renew cert nginx certbot

https://certbot.eff.org/lets-encrypt/centosrhel7-nginx
https://certbot.eff.org/docs/using.html?highlight=staging#nginx

sudo certbot certonly --nginx -d express.ru

А потом скопировать и заменить эти сертификаты по пути, который указа в конфиге нгинкс /etc/nginx/cert

unzip in pod

apk add p7zip
7z x Files.zip