@vite(['resources/css/app.css', 'resources/js/app.js']) Laravel 8

 Laravel 8 does'not support vite

Removing @vite(['resources/css/app.css', 'resources/js/app.js']) and replacing it with


<link rel="stylesheet" href="{{ asset('css/app.css') }}">
<script src="{{ asset('js/app.js') }}" defer></script>

Install Slim 3*

 

 


Installation

It's recommended that you use Composer to install Slim.

$ composer require slim/slim "^3.0"


This will install Slim and all required dependencies. Slim requires PHP 5.5.0 or newer.
Usage

Create an index.php file with the following contents:

<?php

require 'vendor/autoload.php';

$app = new Slim\App();

$app->get('/hello/{name}', function ($request, $response, $args) {
    return $response->getBody()->write("Hello, " . $args['name']);
});

$app->run();


You may quickly test this using the built-in PHP server:

$ php -S localhost:8000

Going to http://localhost:8000/hello/world will now display "Hello, world".


setup http://localhost:8000/hello/world to http://localhost/hello/world

 Create .htaccess file with the following contents:

# Note: see https://httpd.apache.org/docs/current/howto/htaccess.html:
#
# "You should avoid using .htaccess files completely if you have access to
# httpd main server config file. Using .htaccess files slows down your Apache
# http server. Any directive that you can include in a .htaccess file is
# better set in a Directory block, as it will have the same effect with
# better performance."

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]


Installation SLIM 4*

 


System Requirements

Web server with URL rewriting
PHP 7.4 or newer

 

composer require slim/slim:"4.*"

 Step 3: Install a PSR-7 Implementation and ServerRequest Creator

Before you can get up and running with Slim you will need to choose a PSR-7 implementation that best fits your application. In order for auto-detection to work and enable you to use AppFactory::create() and App::run() without having to manually create a ServerRequest you need to install one of the following implementations:
Slim PSR-7

composer require slim/psr7


Nyholm PSR-7 and Nyholm PSR-7 Server

composer require nyholm/psr7 nyholm/psr7-server


Guzzle PSR-7
For usage with Guzzle PSR-7 version 2:

composer require guzzlehttp/psr7 "^2"


For usage with Guzzle PSR-7 version 1:

composer require guzzlehttp/psr7 "^1"
composer require sapphirecat/slim4-http-interop-adapter

Laminas Diactoros

composer require laminas/laminas-diactoros

Step 4: Hello World

Create File: public/index.php

<?php
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Factory\AppFactory;

require __DIR__ . '/../vendor/autoload.php';

$app = AppFactory::create();

$app->get('/', function (Request $request, Response $response, $args) {
    $response->getBody()->write("Hello world!");
    return $response;
});

$app->run();

You may quickly test this using the built-in PHP server:

$ php -S localhost:8000 -t public

 Going to http://localhost:8000/hello/world 

setup  

http://localhost:8000/hello/world 

to http://localhost/hello/world

 

 composer require selective/basepath

Create File: index.php

 <?php
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Factory\AppFactory;
use Selective\BasePath\BasePathDetector;


require __DIR__ . '/vendor/autoload.php';

// Instantiate App
$app = AppFactory::create();

// Add error middleware
$app->addErrorMiddleware(true, true, true);
// Set the base path to run the app in a subdirectory.
// This path is used in urlFor().
$basePath = (new BasePathDetector($_SERVER))->getBasePath();

$app->setBasePath($basePath.'/slim4');




// Add routes
$app->get('/', function (Request $request, Response $response) {
    $response->getBody()->write('<a href="./hello/world">Try /hello/world</a>');
    return $response;
});

$app->get('/hello/{name}', function (Request $request, Response $response, $args) {
    $name = $args['name'];
    $response->getBody()->write("Hello, $name");
    return $response;
});




$app->run();

Add the following line to .htaccess

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ /slim4/index.php [QSA,L]

done

source : https://github.com/slimphp/Slim/issues/2512

 
 https://github.com/slimphp/Slim

https://github.com/selective-php/basepath#installation

No USB devices available in VirtualBox

 No USB devices available in VirtualBox

 

 
Oracle VirtualBox is unable to list/filter the USB devices attached to my system. As a result, the guest OS is not able to see any USB device either.


<no devices available>


Run this script and reboot your computer

sudo adduser $USER vboxusers
sudo usermod -aG vboxusers $USER


source : https://superuser.com/questions/956622/no-usb-devices-available-in-virtualbox

Finding rows that contain numeric or char data in Oracle

  


SQL> select DECODE( TRANSLATE('12345zzz_not_numberee',' 0123456789',' '), NULL, 'number','contains char')
 2 from dual
 3 /
 
SQL> select DECODE( TRANSLATE('12345',' 0123456789',' '), NULL, 'number','contains char')
 2 from dual
 3 /

"number"

 

https://stackoverflow.com/questions/12549029/sql-error-ora-01722-invalid-number

How to use multiple ODBC data sources with Oracle hsodbc / dg4odbc / generic connectivity


 

1.

Create multiple initSID.ora

inithsodbc.ora

HS_FDS_CONNECT_INFO = hsodbc
HS_FDS_TRACE_LEVEL = 0

initz.ora

HS_FDS_CONNECT_INFO = z
HS_FDS_TRACE_LEVEL = 0

 

2.

(SID_DESC =
      (SID_NAME = hsodbc)
      (ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)
      (PROGRAM = hsodbc)

    )
    (SID_DESC =
      (SID_NAME = z)
      (ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)
      (PROGRAM = hsodbc)

    )

3.

HSODBC =
  (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA = (SID = hsodbc))
      (HS = OK)
    )

z =
  (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA = (SID = z))
      (HS = OK)
    )

4.

CREATE DATABASE LINK hsodbc USING 'hsodbc';

CREATE DATABASE LINK z USING 'z';

 

 

 

 

source  : https://knowledgebase.progress.com/articles/Article/6177