Nikola Brežnjak blog - Tackling software development with a dose of humor
  • Home
  • About me
Home
About me
  • Nikola Brežnjak blog
  • Home
  • About me
Quick tips

How to fully open any file after quick searching it in Visual Studio Code

In this quick tip, I’ll show you how to fully open any file after quick searching it in Visual Studio Code.

When you do a quick search (⌘ + P) for some file in Visual Studio Code, and you select it by pressing ENTER, this file is in so-called ‘preview’ mode, and if you end up opening some other file in this manner as well, it will close the former and open the latter in its place. This annoys me to no extent. ?

⚠️ click on the images to see the larger size

To change this, open Visual Studio Code preferences (Code -> Preferences -> Settings)

vscSettings

Enter “workbench.editor.enablePreviewFromQuickOpen”: false into your User Settings:

vscFullyOpen

Save the file, and that’s it.

Hope this solves someone else’s frustration with this ?

How to fully open any file after quick searching it in #VisualStudioCode https://t.co/AcTQMmFB0I

— Nikola Brežnjak (@HitmanHR) November 26, 2017

Quick tips

How to login to Docker hub from the command line

TL;DR

you have to enter your Docker ID, and not your email address ?

!Tl;DR

In this quick tip, I’ll show you (and help me remember forever and always ?) how to login to Docker hub from the command line.

I won’t go into details of why and how Docker is great and why all devs should use it, I’ll leave that for some other post…

I’m using the Docker for Mac desktop app.

You can download a version for your operating system here.

Via the Docker for Mac app I could login without a problem with my email and password.

However, if I typed docker login from the command line, it would constantly keep telling me I provided wrong credentials. On this Github issue I found the solution:

you have to enter your Docker ID, and not your email address ?

How to login to #Docker hub from the #command line https://t.co/kDkBHilEyO

— Nikola Brežnjak (@HitmanHR) October 4, 2017

Quick tips

How to hide the minimap in Visual Studio Code?

This is a quick tip on how to hide the minimap in Visual Studio Code.

In case you’re wondering why someone would like to do this? The answer is that if you have two files open side by side on a screen that’s not too big then any extra space on the screen will come handy.

Surprisingly, there’s no such option in any of the dropdown menus (like it is in Sublime Text 3 for example), so you’ll first have to go to:

Code -> Preferences -> Settings

Screen Shot 2017-07-23 at 11.48.33

Then, enter the following in your user settings object on the right:

"editor.minimap.enabled": false

minimapVisualStudioCode

You can search for any setting and see its default settings on the left-hand side. If you want to change it, just copy it in the object on the right-hand side, change the value, save, and you’re done. 

Btw, even though I’m a paying user of Sublime Text 3, I must admit I’m liking Visual Studio Code more every day. How’s the situation with you guys? Are you also a long-time ST3 user and have tried VSC? If so, I’d like to hear your thoughts about it…

How to hide the #minimap in Visual Studio #Code? https://t.co/81uHJAlpiT

— Nikola Brežnjak (@HitmanHR) August 6, 2017

Quick tips

How to Format Code on Every Save in Visual Studio Code?

This is a quick tip on how to format (prettify) the code every time you save a certain file in Visual Studio Code.

First, go to:

Code -> Preferences -> Settings

Screen Shot 2017-07-23 at 11.48.33

Second, enter the following in your user settings object on the right:

"editor.formatOnSave": true

Screen Shot 2017-07-23 at 11.50.39

You can search for any setting and see its default settings on the left-hand side. If you want to change it, just copy it in the object on the right-hand side, change the value, save, and you’re done. Now your HTML and JavaScript files will re-indent nicely on every save.

Btw, even though I’m a paying user of Sublime Text 3, I must admit I’m liking Visual Studio Code more every day. How’s the situation with you guys? Are you also a long-time ST3 user and have tried VSC? If so, I’d like to hear your thoughts about it…

How to #Format Code on Every Save in Visual Studio #Code? https://t.co/keI3ktj5Pg

— Nikola Brežnjak (@HitmanHR) July 23, 2017

Quick tips

How to stop and remove MySQL server on a Mac but keep the client

Remove MySQL server on a Mac

The other day I wanted to run some project via Docker Compose. Surprisingly, the MySQL service defined normally like this:

mysql:
       image: tutum/mysql
       env_file:
         - docker.env
       ports:
         - "3306:3306"

didn’t start, because I apparently had MySQL server already running locally.

Trust me, I tried everything from this StackOverflow post but any time I tried to kill the process (that I saw is running with ps aux | grep mysql) it would spun back up.

Then, I remembered that I installed MySQL server some time ago via the app called MAMP. I went in and removed all of that and also I found one post that I’ll paste here (full credit to Vitor Britto):

# Remove MySQL completely

1. Open the Terminal
2. Use `mysqldump` to backup your databases
3. Check for MySQL processes with: `ps -ax | grep mysql`
4. Stop and kill any MySQL processes
5. Analyze MySQL on HomeBrew: 

    ```
    brew remove mysql
    brew cleanup
    ```

6. Remove files: 

    ```
    sudo rm /usr/local/mysql
    sudo rm -rf /usr/local/var/mysql
    sudo rm -rf /usr/local/mysql*
    sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
    sudo rm -rf /Library/StartupItems/MySQLCOM
    sudo rm -rf /Library/PreferencePanes/My*
    ```

7. Unload previous MySQL Auto-Login: 

    ```
    launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
    ```

8. Remove previous MySQL Configuration: 

    ```
    subl /etc/hostconfig` 
    # Remove the line MYSQLCOM=-YES-
    ```

9. Remove previous MySQL Preferences: 

    ```
    rm -rf ~/Library/PreferencePanes/My*
    sudo rm -rf /Library/Receipts/mysql*
    sudo rm -rf /Library/Receipts/MySQL*
    sudo rm -rf /private/var/db/receipts/*mysql*
    ```

10. Restart your computer just to ensure any MySQL processes are killed
11. Try to run mysql, **it shouldn't work**

Keep the MySQL client for interacting with the MySQL databases

At this point, I removed everything related to MySQL, but I still needed the client to connect to the MySQL database that I ran with Docker Compose.

The fastest way (that I’ve found in this StackOverflow post) to install the client without installing the server was to install MySQLWorkbench and then add this to your path (I put these in my .zshrc file; you may use .bashrc):

export PATH=$PATH:/Applications/MySQLWorkbench.app/Contents/MacOS

Of course, the path may vary for you in case you’ve installed it in some other location. Anyway, hope this helps someone… ?

How to stop and remove #MySQL server on a Mac but keep the client https://t.co/0vtuBgOqMD

— Nikola Brežnjak (@HitmanHR) May 11, 2017

Miscellaneou$, Quick tips

Gitflow – a successful Git branching model

edit 14.4.2017: I made a 2.5k+ word post about Gitflow, Pull Requests and Code Reviews which goes way deeper in the topic. The post is here if you want to check it out: Git branching done right with Gitflow & improving code quality with code reviews.

Before I started working on my newest project, I took the time to finally delve into the proper way of doing branching. Not long into the research gitflow popped up as the more/less something that community loves.

After checking it out, I’m amazed how awesome this is.

So, first things firs; the original article was written by Vincent Driessen: A successful Git branching model goes into the details of this workflow.

Later I found out that community built the git-flow command line program that provides high-level repo operations for Vincent Driessen’s branching model.

Tutorial

  • 15min video

Installation

Simple brew install git-flow if you’re on Mac.

Git-flow command completion

Use tabs to auto-complete the git-flow commands: https://github.com/bobthecow/git-flow-completion. Completions available for both bash and zsh.

Gitflow – a successful Git branching model https://t.co/1ecyQ5qlTd

— Nikola Brežnjak (@HitmanHR) June 14, 2016

Quick tips

Your Apple Developer Program membership has expired

TL;DR: If your Apple Developer Program expires then your apps are taken off the App Store as well 1415131129_smiley-evil

So the other day I got an email from Apple saying that:

You are no longer a member of the Apple Developer Program and any apps you had on the App Store or Mac App Store are no longer available. Renew your membership to reinstate your apps for download, submit new apps, and get personal technical support.

I’ll be honest and tell you that I initially thought that you can’t upload any new apps if you don’t have a Developer Account since that seemed totally logical. However, I didn’t think that they would also take down any existing apps that you have in the App Store.

Ah, dear Apple, live and learn I guess…

Your #Apple Developer Program membership has expired https://t.co/19pv6Rg3du pic.twitter.com/8cFO73c4x9

— Nikola Brežnjak (@HitmanHR) February 13, 2016

PHP, Quick tips

M is not for minutes in PHP date function

Ah, it was one of those days when you’re too smart for your own good and you don’t check the docs and falsely assume that m must definitely be minutes in the date function in PHP.

It should be

$dateNow = date("Y-m-d H:i:s");

and not H:m:i!

The offcial docs are clear, one just needs to read them 🙂

Quick tips

How to open current folder in Explorer from Command prompt on Windows

To open current folder in Explorer from Command prompt on Windows use the following command:

explorer .

The dot (.) represents the current directory.

This is usually useful for when you’re using Command prompt (or any other you prefer, like Console2 for example) to navigate through your folders but then you need to open the current one for some reason in the Explorer.

You also may want to check out How to open current folder in Finder from Terminal on Mac OS X.

Quick tips

How to open current folder in Finder from Terminal on Mac OS X

To open current folder in Finder from Terminal on Mac OS X use the following command:

open .

The dot (.) represents the current directory.

This is usually useful for when you’re using Terminal (or any other you prefer, like iTerm2 for example) to navigate through your folders but then you need to open the current one for some reason in the Finder application.

You also may want to check out how to open current folder in Explorer from Command prompt on Windows.

Page 2 of 5«1234»...Last »

Recent posts

  • Productivity tip: rate things 1-10 without 7
  • Productivity: Paper, Pomodoro, Kanban, Tracking, and actually showing up
  • The Keyboard Layout That’s Making Us Type Slower
  • Stop Tabbing. Start Using Your Monitor
  • StackOverflow – Was It Worth It?

Categories

  • Android (3)
  • Books (114)
    • Programming (22)
  • CodeProject (36)
  • Daily Thoughts (78)
  • DevThink (2)
  • Go (3)
  • iOS (5)
  • JavaScript (128)
    • Angular (4)
    • Angular 2 (3)
    • Ionic (61)
    • Ionic2 (2)
    • Ionic3 (8)
    • MEAN (3)
    • NodeJS (27)
    • Phaser (1)
    • React (1)
    • Three.js (1)
    • Vue.js (3)
  • Leadership (1)
  • Meetups (8)
  • Miscellaneou$ (83)
    • Breaking News (8)
    • CodeSchool (2)
    • Hacker Games (3)
    • Pluralsight (7)
    • Projects (2)
    • Sublime Text (2)
  • PHP (6)
  • Quick tips (44)
  • Servers (8)
    • Heroku (1)
    • Linux (3)
  • Stack Overflow (82)
  • Unity3D (9)
  • VibeCoding (2)
  • Windows (8)
    • C# (2)
    • WPF (3)
  • Wordpress (2)

"There's no short-term solution for a long-term result." ~ Greg Plitt

"Everything around you that you call life was made up by people that were no smarter than you." ~ S. Jobs

"Hard work beats talent when talent doesn't work hard." ~ Tim Notke

© since 2016 - Nikola Brežnjak