Animation effect on the Modern framework

/* Fade in landing page captions */
[data-block-internal-id="core_slider_fullscreen"] .fullscreen-image-slider .orbit__caption {
    animation: fadeIn 1.5s ease;
}
/* Animate landingpage caption and logo */
#block-core-slider-regular, [data-block-internal-id="core_slider_fullscreen"] .fullscreen-image-slider article,
  [data-block-internal-id="core_slider_fullscreen"] .fullscreen-image-slider h1 {
     animation: slideDown 1.5s ease; 
     position: relative;
}
main, .footer, [data-block-internal-id="core_slider_fullscreen"] .fullscreen-image-slider .orbit__caption .grid-x {
    position: relative;
    animation: slideUp 1.5s ease;
}
.not-front .layout-container {
    animation: fadeIn 2s ease;
}
@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}
@keyframes slideDown {
    from {top: -30px;}
    to {top: 0;}
}
@keyframes slideUp {
    from {bottom: -30px;}
    to {bottom: 0;}
}

Various Errors

use Illuminate\Support\Str;

$random = Str::random(40);

Laravel Startup (with vue and tailwind)

1) laravel new <project-name>
2) composer require laravel/ui
3) php artisan ui vue --auth
4) npm install tailwindcss
5) resources/sass/app.scss replace whats inside with:
  @import "tailwindcss/base";
  
  @import "tailwindcss/components";
  
  @import "tailwindcss/utilities";
  
4) touch tailwind.config.js (root directory):
  module.exports = {
    purge: [],
    theme: {
      extend: {},
    },
    variants: {},
    plugins: [],
  }
  
5) webpack.mix.js:

  const mix = require('laravel-mix');
  const tailwindcss = require('tailwindcss');
  
  mix.disableNotifications();
  
  mix.js('resources/js/app.js', 'public/js');
  
  mix.sass('resources/sass/app.scss', 'public/css')
  .options({
     processCssUrls: false,
     postCss: [ tailwindcss('./tailwind.config.js') ],
  })

Docker RUN

# docker run examples:
docker run --rm -it 1kg_portal #this creates an interactive containter on image
named (1kg-portal) and it will remove this container when you exit

Apachie wont start all of a sudden SELinux



on command line type journalctl -xe and the results will be

SELinux is preventing /usr/sbin/httpd from name_bind access on the tcp_socket port 83 or 80

This means that the SELinux is running on your machine and you need to disable it. then edit the configuration file by type the following

nano /etc/selinux/config

Then find the line SELINUX=enforce and change to SELINUX=disabled

Then type the following and run the command to start httpd

setenforce 0

Lastly start a server

systemctl start httpd

Selection Sort

# O(n^2) time | O(1) space
def selectionSort(array):
    currentIdx = 0
    while currentIdx < len(array) - 1:
        smallestIdx = currentIdx
        for i in range(currentIdx + 1, len(array)):
            if array[smallestIdx] > array[i]:
                smallestIdx = i
        swap(currentIdx, smallestIdx)
        currentIdx += 1
    return array
        
def swap(i, j, array):
    array[i], array[j] = array[j], array[i]

nfs

#手动挂载
mount -t nfs -o vers=3,timeo=600,nolock 10.10.1.1:/share /localfolder

Network N - Bulk API Template

import os
import sys
import urllib
import urllib2
import cookielib
import urlparse
import hashlib 
import hmac
import base64
import json
import random

# 1. Enter your BlueKai developer keys

bkuid = 'ENTER PUBLIC API KEY' #Web Service User Key
bksecretkey = 'ENTER SECRET API KEY' #Web Service Private Key

# 2.  Other Details

siteID = '87337' # Your Bulk API Site ID
responseCallBackUrl = "ENTER ENDPOINT TO SEND RESPONSES TO" # OPTIONAL
responseType = "Detail" # "Detail", "Summary" or None" (controls the level of detail sent back in the response to your endpoint)

# bkuuids - queue up your IDs here

# NOTE THAT THIS SCRIPT GENERATES THE SAME DATA PER BKUUID HERE AS IT'S JUST A WAY OF TESTING

bkuuids  = []
bkuuids.append('bkuuid_1') #Enter in a PUUID here you want to test
bkuuids.append('bkuuid_2') #Enter in a PUUID here you want to test (repeat for more)
bkuuids.append('bkuuid_3') #Enter in a PUUID here you want to test (repeat for more)

# Set phint(s) string 
phints = 'phint=dwellti

SimplePID

[System.Serializable]
public class SimplePID {
    public float Kp = 1f;
    public float Ki = 0f;
    public float Kd = .1f;

    float _lastError;
    float _p, _i, _d;

    public void Reset() {
        _lastError = 0;
    }

    public float Update(float error, float dt) {
        _p = error;
        _i += error * dt;
        _d = (error - _lastError) / dt;
        _lastError = error;
        return _p * Kp + _i * Ki + _d * Kd;
    }
}

reducer替代redux

import Redux , { createStore } from "redux";

let initStates = {
  num:0
}

let reducer = (state,action) =>{
  let {num} = state;
  switch(action.type){
    cate "ADD",
        return {num: ++num}
        break;
    default:
        return state
        break;
  }
} 

export default {
  initStates,
  reducer
};

Redux简单例子

import Redux , { createStore } from "redux";

let initStates = {
  num:0
}

let reducer = (state,action) =>{
  let {num} = state;
  switch(action.type){
    cate "ADD",
        return {num: ++num}
        break;
    default:
        return state
        break;
  }
}

let store = createStore(reducer,initStates);

export default store;

Prime String

#include <bits/stdc++.h>
using namespace std;

#define mod 1000000007
vector<bool> SOE (1000000, true);

void buildSOE()
{

    SOE[0] = false;
    SOE[1] = false;

    for (int p=2; p*p <= 1000000; p++)
    {
        if (SOE[p] == true)
        {
            for (int j = p*p; j <= 1000000; j += p)
                SOE[j] = false;
        }
    }
}

bool isPrime (string s)
{
    int n = stoi(s);
    return SOE[n];
}

int rec (string &s, int i, vector<int> &dp)
{
    if(dp[i] != -1)
        return dp[i];

    int count = 0;

    for (int j=1; j<=6; j++)
    {
        if (i-j>=0 && s[i-j] != '0' && isPrime(s.substr(i-j, j)))
            count += rec(s, i-j, dp);
            count %= mod;
    }
    return dp[i] = count;
}

int countprimestrings (string &s)
{
    int n = s.size();
    vector<int> dp(n+1, -1);
    dp[0] = 1;
    return rec(s, n, dp);
}

int main()
{
    buildSOE();
    string s = "3175";
    //cin>>s;
    cout<<countpr

zshrc

# oh-my-zsh
export ZSH="/Users/ryoma.kawahara/.oh-my-zsh"
ZSH_THEME="refined"

plugins=(
  git,
  zsh-syntax-highlighting,
  zsh-completions,
  zsh-autosuggestions
)
source $ZSH/oh-my-zsh.sh
autoload -U compinit && compinit -u

# docker
export DOCKER_BUILDKIT=1
alias d-c='docker-compose'

# useful ailias
function mkdircd () { mkdir -p "$@" && eval cd "\"\$$#\""; }
alias vzsh='sudo vim ~/.zshrc'
alias szsh='source ~/.zshrc'

# ruby
eval "$(rbenv init -)"

# mysql
export PATH="/usr/local/opt/mysql@5.7/bin:$PATH"

ORCL - Fichier inventory

/app/product/19.3/grid/oui/bin/runInstaller -attachHome ORACLE_HOME=/app/product/19.3/grid ORACLE_HOME_NAME=Grid19cHome "CLUSTER_NODES={runbdd303,runbdd304}" INVENTORY_LOCATION=/app/oraInventory  CRS=true LOCAL_NODE=runbdd304

Плашка с ковидом для Hotel-Aleksandr

  <div class="covid">
      <p><?= ($current_lang === "ru") ? "Дорогие гости! Отель возобновит работу с 01.07.2020" : "Dear guests! Hotel will be open 01.07.2020" ?></p>
  </div>

nodejs .env loader

require('dotenv').config()
const someKey = process.env.someKey