Categories
Mastering Development

trying to pass control to a Proc from inside a method for irritation but my syntax is wrong in ruby

array = [1, 2, 3] double = Proc.new { |num| num * 2 } def custom_each(array) count = 0 result =[] while count < array.length result << yield(array[count]) {&double} count += 1 end result end p custom_each(array) **the error:** /home/ec2-user/environment/ruby/Practise/01_tutorial.rb:9: syntax error, unexpected ‘{‘, expecting end …result << yield(array[count]) {&double} Process exited with code: 1 […]

Categories
CMS Mastering Development Wordpress

WP-CLI `user create` failing on woocommerce

I am trying to use the wp user create <user-login> <user-email> –role=<role> and the following error: PHP Parse error: syntax error, unexpected ‘:’, expecting ‘{‘ in /home/<user>/public_html/wp-content/plugins/woocommerce/woocommerce.php on line 56… Ln56: function wc_get_container() : \Psr\Container\ContainerInterface { Ideas?

Categories
CMS Magento Mastering Development

Adding custom Fields to magento shipping

Hi am trying to add two custom fields on checkout but its not working am getting error while running compile commands Error:- Compilation was started. Service data attributes generation… 2/7 [========>——————-] 28% 50 secs 210.0 MiBPHP Parse error: syntax error, unexpected ‘-‘, expecting ‘(‘ in E:\xampp\htdocs\m2\generated\code\Magento\Checkout\Api\Data\ShippingInformationExtensionInterface.php on line 78 Parse error: syntax error, unexpected ‘-‘, […]

Categories
CMS Mastering Development Wordpress

Why is my wp_enqueue_style() not working?

I am new to wordpress and am trying to develop a child theme on localhost for the first time. I am trying to load style.css using this code in functions.php. This is the entire functions.php file: <?php //registers styles in header function load_stylesheets() { wp_register_style(‘bootstrap’, get_stylesheet_directory_uri().’/assets/css/bootstrap.css’, array(), false, ‘all’); wp_enqueue_style( ‘bootstrap’); wp_register_style(‘style’, get_stylesheet_directory_uri().’/style.css’, array(), false, […]

Categories
CMS Mastering Development Wordpress

Fatal error: Call to undefined function load_theme_textdomain() in /var/www/vhosts/61/151172/webspace/httpdocs/wp-includes/functions.php on line 5

I am a complete rookie. Tried to hide the tags on my website & saw in a video if I add a code to functions.php it will do the job but instead I got the white screen of death. Oops. If I replace the function.php file with a fresh WordPress download file I get this […]

Categories
Mastering Development

I’m not able to run UPDATE query in mysql [duplicate]

Hello i’m newbie in programming with PHP and MYSQL, at the moment i’m trying to update info inside o mysql database. i’m running this php: insertdata.php <?php ob_start(); session_start(); ?> <?php /* Attempt MySQL server connection. Assuming you are running MySQL server with default setting (user ‘root’ with no password) */ $link = mysqli_connect(“host”, “user”, […]

Categories
Mastering Development

ERROR | PHP syntax error: syntax error, unexpected ‘}’, expecting end of file

What I’m doing I am developing a WordPress plugin and I’m at a point to follow the standards of the WordPress. Error There is this error in terminal. PHP syntax error: syntax error, unexpected ‘}’, expecting end of file. I’m thinking, if there is missing or any extra }(bracket), then why there is no errorin […]

Categories
CMS Mastering Development Wordpress

Disable Adsense ad code in 404 deleted posts and pages

recently I got deleted some of older posts, now AdSense crawler throws a continuous error so that I used a code to block AdSense on 404 pages, I found an online solution, The php-code snippet which hides/blocks Adsense ads on 404’s is: ADD HERE YOUR ADSENSE CODE Note: the logic of the code is to […]

Categories
Mastering Development System & Network

Unknown PTR record in DNS; it’s not there in Cloudflare DNS Settings

(1.) There is an extra, unwanted, unexpected, unadded PTR record in my DNS settings, with value set to the Domain Name “mediati.net”. You can see it here in MxToolbox Reverse Lookup: MxToolbox shows unwanted PTR TXT record (2.) cPanel also notices and complains about the extra PTR record: cPanel also complains about the extra PTR […]

Categories
Mastering Development

Setting URL with logged in user id from the front end blade in LARAVEL 6

Hello I’m trying to set an URL (href) from my blade(welcome.blade.php) to logged in user’s user profile. My url has to be like this -> sample.com/profile/24 there, 24 is logged in user’s user id <a href=”‘)}}” class=”btn btn-primary”>profile</a> but when I run the code it gives me following exception, Facade\Ignition\Exceptions\ViewException syntax error, unexpected ‘}’, expecting […]