React Framework for development Get basics on their intro course
Vercel – Deployment
Similar to Heroku , Vercel is a deployment and collaboration platform for frontend developers. It enables developers to host websites and web services that deploy instantly and scale automatically – all without any config. Using the CLI can be very good. requirements – NODE – GIT Create NextJS App […]
WordPress support WebP
Topic can be found on official site Extra code to go to the functions.php Uploading WebP images to WordPress? Just add snippet to theme functions.php file. //** *Enable upload for webp image files.*/ function webp_upload_mimes($mimes) { $mimes[‘webp’] = ‘image/webp’; return $existing_mimes; } add_filter(‘mime_types’, ‘webp_upload_mimes’); To see image (thumbnail) preview when […]
Ngrok tunnel
Good choice for localhost dev with ngrok – tunnel local ports to public URLs and inspect traffic To use in node development use NPM docs ngrok exposes local networked services behinds NATs and firewalls to the public internet over a secure tunnel. Share local websites, build/test webhook consumers and self-host […]
Vagrant Full Intro
Some of the main parts vagrant -v Must have a Vagrantfile – the core file . Written in ruby it has 5 main parts: – config.vm.box – OS ( ubuntu16.04 say ) – config.vm.provider – virtualbox ( could be hyperv , etc… ) – config.vm.network – how the host sees […]
PHP working with CSV
Quick info on how to import export csv /** * CREATE A TABLE * CREATE TABLE `php_csv`.`users` ( * `id` INT NOT NULL AUTO_INCREMENT , * `f_name` VARCHAR(30) NOT NULL , * `l_name` VARCHAR(30) NOT NULL , * `age` INT NOT NULL , * PRIMARY KEY (`id`) * ) ENGINE = InnoDB; */ class CSV extends mysqli { private $state_csv = false; public function __construct() { parent::__construct( HOST, NAME, PASSWORD, DBNAME); if ($this->connect_error) { echo “Failed to connect to DB: “. $this->connect_error; } } public […]
Laravel – variable exists in the blade directive
@isset($checkvariable ) <p>Your data is here!</p> @endisset @if(empty($checkvariable )) <p>Data does not exist</p> @else <p>Your data is here!</p> @endif For Laravel 5.7 onwards use. {{ $checkvariable ?? ‘not-exist’ }} For Laravel version <5.7 {{ $checkvariable or ‘not-exist’ }} Sample-1: @if( !empty($data[‘var’])) {{ $data[‘var’] }} @endif Sample-2: {{ $data[‘var’] or ‘no […]
JavaScript Import Export
Working modules
JavaScript Practical Use snipets
Assigning variables #1. Using an object to pass to func function about(args) { console.log(“Name ” + args.name + ” and “+ args.age); } about({ name: “Serg”, age: 22 }); #2 Function generator function* idGenerate() { let id = 2 // or could be anything else while (true) { yield id++; […]
JavaScript Localization Tips
// 512145.14 var num = 512145.14; Number var numFormat = new Intl.NumberFormat(‘ru-RU’); var out = numFormat.format(); // “512 145,14” Percentage out = new Intl.NumberFormat(“en-UK”, { style: “percent” }).format(0.55); // “55%” Currency out = new Intl.NumberFormat(“en-UK”, { style: “currency”, currency: “GBP” }).format(1244.42) // “£1,244.42” Units – Speed out = new Intl.NumberFormat(“en-UK”, { […]