Image for post
Image for post
https://unsplash.com/@glenncarstenspeters

TL;DR

Override your method with $event, and then add your parameters after that

<v-select @change=”updateMethodHere($event,param2,param3,etc.)”></v-select>

INTRO

So if you are like me, you tend to forget some of the litter nuances of frameworks. Especially if you’re writing a multiple languages. In 5 minutes, you might touch python for your backend, PHP for your website, view for your front end, and then be knee-deep in MySQL queries.

As I was working on a piece of one of my Vue Components, I was trying to get an :on-click event to handle multiple parameters. However, for some reason I could only get the value paraments of the <v-select> to appear in one of my methods that I was calling on the event. …


Image for post
Image for post

INTRO

If you are anything like me, and have common sense in the workplace, you don’t want to waste your time watching videos that re-iterate what you have already learned AND apply on a daily basis in the workplace. Below are the steps to skip through those videos.

STEPS

  1. Open up Chrome or Edge
  2. Go to the video’s page and start playing the video.
  3. Go to DevTools →Console
  4. Run the following code while the video is playing:
let boring = document.querySelector('video');
boring.currentTime = boring.duration

That’s it! The video will automatically fast forward to the end and you can move to the next video/exercise.

Enjoy! Now get back to coding something great!!


Image for post
Image for post

THE INTRO

I tried searching through a HD that I have for a particular file. However, using the Search in Window Explorer is slow. And using Powershell was even worse. The following code made me want to go be a farmer in the hills…

ls DIRECTORY_LOCATION_HERE | Select-String "Blah"

So I turned to my favorite snake, Python!!!

THE CODE

Below is the code I wrote to find all files that included my search term. Enjoy.

Happy Coding! And if you haven’t already done so, make sure to subscribe to Code Kings publication on Medium for other tips and tricks.


Image for post
Image for post

This is a quick guide on how to successfully share a local drive inside your VM running on Virtualbox.

TL;DR

  • In VirtualBox, go to Settings → Shared Folders → Click on Folder with plus sign. Add the location of your drive, click Auto Mount.
  • In your VM, run sudo apt-get install virtualbox-guest-utils
  • Restart your VM
  • should have created a new sf_DRIVE_NAME under /media directory

Happy Coding!


Image for post
Image for post

Intro

For a project that I am currently working on, I am creating a chat application within a single page Vue application with a Laravel backend, and then I ran into this problem.

Problem

I ran into an issue where as I would have users disconnect and reconnect to the chat instance (aka the Echo listeners), they would hear the same event multiple times. So if a user typed “Hello” and they had entered/exited the chat box 4x. They would get:

Hello
Hello
Hello
Hello

Solution

This is because you have one global Pusher Echo instance running on your main part of your app. Simply disconnect() and then re-instantiate the Echo object. It will destroy the instantiated listeners. Then simply re-attach your listeners and you are good. In my case, I simply created a new Echo instance that I could destroy and re-create as needed for my chat application.

Happy Coding.


Image for post
Image for post

Intro

While I was sitting here at work trying to do some C# work on Ellie Mae’s Encompass Platform, I thought I’d share a quick post about how to modify a registry key in Powershell. You can also use the regedit tool if you’d like, but I prefer to live in terminals & consoles :).

How-To

Open up Powershell in Administrator mode.

Image for post
Image for post

On a normal Windows installation you can go to

cd HKLM:\

However, if you are unsure what drive or dir your HKLM is, you can use the command to view all your connected drives in Powershell:

Get-PSDrive

You’ll get an output similar to…


Image for post
Image for post

Problem

I was sitting at a co-working space and I wanted to get my VM on the local network. However, I wasn’t sure what IPs were available on the network, so I wanted to make sure which ip’s were available, or at least not being used at this present time. I went to use my ol’ trust Nmap program to scan the network and got this error

dnet: Failed to open device eth0

Root Problem

My Npcap was out of date.

Solution

If you are using Win 10, make sure to download the latest version of Nmap and Npcap. Should be good after that. I ran mine via Powershell.

Happy Coding!


Image for post
Image for post
Postman….get it?….

The Problem

When I try to ping my local laravel valet site with Postman API Explorer, I get this error:

Image for post
Image for post

The Issue

When you use laravel valet’s secure option ( to auto generate a secure https connection), it creates it’s own SSL cert for your local environment. However I suspect that Postman doesn’t have a CA that can authenticate that newly created SSL cert, therefore it fails

The Workaround

Although, this is a “solution”, I would perfer to call this more of a workaround, as it’s more of a temporary fix that will affect other sites you use with Postman, so remember to change back the follow setting after use.

  1. Go to Settings → General → SSL certificate verification → set to OFF
Image for post
Image for post

Again, make sure to re-enable this for your other sites, otherwise you won’t be validating proper SSL connections with other sites.

Happy Coding!


Image for post
Image for post

PROBLEM

I found myself running into a problem with my Laravel Valet when running Vue.js devtools. To install the Vue.js devtools I ran:

yarn run my_script_name_in_my_package_json_file

It wouldn’t render Vue and I got this error when trying to run

valet secure my_site_namedyld: Library not loaded: /usr/local/opt/icu4c/lib/libicuio.64.dylib
Referenced from: /usr/local/bin/php
Reason: image not found

SOLUTION

Upon doing some research I found this has something to do with brew not using the proper dependencies for the icuio64 library. Here is a quick script to reinstall the apps that use icuio64 as a dependencies

brew uses --installed icu4c | xargs brew reinstall

Once that script is completed, you might have to manual remove the reinstall package from the “Cellar” of the Brew installation. It will give you instructions on how to do that in the terminal. …


Image for post
Image for post

Solution

Change the DB config to see the MySQL box name (like devboxsql) in your hostname, can’t use localhost, since, well, technically it’s not on the localhost of your php container.

About

Tony Mucci

Founder of My Company Tools • Co-Founder of Dree • Co-Founder of Eklect Enterprises. Opinions on this blog are my own.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store