Nikola Brežnjak blog - Tackling software development with a dose of humor
  • Home
  • Daily Thoughts
  • Ionic
  • Stack Overflow
  • Books
  • About me
Home
Daily Thoughts
Ionic
Stack Overflow
Books
About me
  • Home
  • Daily Thoughts
  • Ionic
  • Stack Overflow
  • Books
  • About me
Nikola Brežnjak blog - Tackling software development with a dose of humor
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

Books

Executed – RR Haywood

Executed is a second book from the Extracted trilogy. Same as with the first book (Extracted), I don’t have any special quotes, but I really enjoyed the story and characters; Harry, Safa, and Ben just rock!

Taken from the official website:

The team of heroes extracted from their timelines to stop the impending apocalypse didn’t think they needed a leader.

But they’ve got one anyway

With their mission in tatters, Miri has been called in to steady the ship. And to focus them on their assignment: preventing the end of the world.

The problem is, the world doesn’t know it’s in danger. With governments pursuing them relentlessly, attempting to steal the time-travel device to use for their own ends, the heroes are on the run—fighting for survival in a world they’re supposed to save.

Meanwhile, Miri has motives of her own. And when the existence of a second device is discovered, the team’s mission and their lives are in mortal danger…

Can’t wait for the final book in the trilogy! ?

⚠️ In case you’re into stories that deal with time travel then please recommend!

I just read a great sequel #Executed by @RRHaywood https://t.co/3IIHEFf0yF

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

Ionic

How to make Ionic 1 app look good on iPhone X

In this post, I’ll show you how to make your Ionic 1 app look good on iPhone X. The instructions below assume you have the old Ionic CLI (1.x version) and not the new one (3.x version).

TL;DR

  • Add the new viewport meta tag
  • Update the status bar plugin
  • Update the splash screen plugin
  • Update Ionic to latest 1.x version
  • Build the app in Xcode 9
  • Add the new app icon

!TL;DR

Add the new viewport meta tag

Add the new viewport meta tag to your index.html file like this:

<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

Update the status bar plugin

Simply remove the plugin and add it back again, but using the GitHub repo (as it may not yet be merged), like this:

ionic plugin rm cordova-plugin-statusbar
ionic plugin add https://github.com/apache/cordova-plugin-statusbar.git

Update the splash screen plugin

Same as with the status bar plugin, you can do the following:

ionic plugin rm cordova-plugin-splashscreen
ionic plugin add cordova-plugin-splashscreen

Update Ionic to the latest 1.x version

Update Ionic to the latest 1.x version (1.3.5 as of this writing) with the following command:

bower install ionic-team/ionic-bower#1.3.5

You will be prompted to install some additional packages, and for those packages, you’ll have to choose the version of Angular you want to use with them. When asked, make sure to choose 1.5.3 (at the time of writing this).

Build the app in Xcode 9

Update Xcode to the newest version (9.1 currently). Execute the ionic prepare ios command, and open up the platforms/ios/MyApp.xcodeproj file using Xcode. If you have a platforms/ios/MyApp.xcworkspace file in there as well, open that one instead.

⚠️ Now, here’s a potentially tricky part. Say that you had Xcode 8 till recently and you updated everything as outlined above. Then, just before updating to Xcode 9, you have to do ionic prepare ios and open the project in Xcode and update to the new Swift syntax (in case you haven’t done this before). Then, when you open it up in Xcode 9, you’ll be able to update to Swift syntax 4. Again, this may only be a potential problem, but I’m stating it here since I ran into it. The problem is that Xcode 9 can’t update from Swift 2 to 4 syntax out of the box.

Add the new app icon

Finally, please note that for new submissions to the Apple Store, you’ll need to provide the new 1024×1024 px icon. You can add this image to your Image assets:

or you can upload it manually to iTunes when submitting a new version of your app.

Hope this helps someone ?

How to make #Ionic 1 app look good on #iPhone X https://t.co/sIh0dwexZW

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

Books

Finding Ultra – Rich Roll

My favorite quotes from a remarkable biography Finding Ultra: Rejecting Middle Age, Becoming One of the World’s Fittest Men, and Discovering Myself by Rich Roll, a man who finished EPIC5 in under a week: each day a full ironman-distance triathlon (2.4 mile swim, 112-mile bike and 26 mile run) on 5 different islands of Hawaii. Respect!

You can set a positive example. But you simply can not make someone change.

Spirolina

Pursue what’s in your heart and the Universe will conspire to support you.

The prize never goes to the fastest guy,” Chris replied. “It goes to the guy who slows down the least.” True in endurance sports. And possibly even truer in life.

David Goggins quote I’d read years back—the idea that when you believe you’ve reached your absolute limit, you’ve only tapped into about 40 percent of what you’re truly capable of. The barrier isn’t the body. It’s the mind.

With obstacles comes the opportunity for growth. And if you’re not growing, you’re not living. Do what you love; love those you care about; give service to others; and know that you’re on the right path. There’s a new path waiting for you, too. All you have to do is look for it—then take that first step. If you show up and stay present, that step will eventually become a gigantic leap forward. And then you’ll show us who you really are.

When purpose aligns with faith, there can be no failure and all needs will be met—because the universe is infinitely abundant.

My #notes from a remarkable #book Finding Ultra by Rich Roll https://t.co/rzn7qsigqY

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

Go

Go logger with Kubernetes Stackdriver format compatibility

I’m so proud to announce that a Go Logger package that our backend team at TelTech was working on is now open-source! It is our library for structured logging mechanism for Go projects running via Kubernetes with Stackdriver format compatibility.

For those who’d like to get started with Kubernetes, here are two free courses:

  • Scalable Microservices with Kubernetes by Google on Udacity. Kelsey Hightower is one of the instructors here!
  • Introduction to Kubernetes by edX

For the curious, here’s an overview of logging in Kubernetes.

Installation

go get -u github.com/teltech/logger

Usage

package main

import (
    "github.com/teltech/logger"
)

// There should be a LOG_LEVEL environment variable set, which is read by the library
// If no value is set, the default LOG_LEVEL will be INFO

func main() {
    // Stackdriver requires a project name and version to be set. Use your environment for these values.
    // SERVICE should be your GCP project-id, e.g. robokiller-146813
    // VERSION is an arbitrary value
    log := logger.New()

    // You can also initialize the logger with a context; the values will persist throughout the scope of the logger instance
    log = logger.New().With(logger.Fields{
        "user":   "+1234567890",
        "action": "create-account",
    })

    param := "something useful here"

    // A metric is an INFO log entry without a payload
    log.Metric("CUSTOM_METRIC_ENTRY")

    // Log a DEBUG message, only visible in when LOG_LEVEL is set to DEBUG
    log.With(logger.Fields{"key": "val", "something": true}).Debug("debug message goes here")
    log.With(logger.Fields{"key": "val"}).Debugf("debug message with %s", param)

    // Log an INFO message
    log.With(logger.Fields{"key": "val", "names": []string{"Mauricio", "Manuel"}}).Info("info message goes here")
    log.With(logger.Fields{"key": "val"}).Infof("info message with %s", param)

    // Log a WARN message
    log.With(logger.Fields{"key": "val"}).Warn("warn message goes here")
    log.With(logger.Fields{"key": "val"}).Warnf("warn message with %s", param)

    // Error() prints the stacktrace as part of the payload for each entry and sends the
    // data to Stackdriver Error Reporting service
    log.With(logger.Fields{"key": "val"}).Error("error message goes here")
    log.With(logger.Fields{"key": "val"}).Errorf("error message with %s", param)
}

Output

The errors require a specific JSON format for them to be ingested and processed by Google Cloud Platform Stackdriver Logging and Error Reporting. See this post for more info. The resulting output has the following format, optional fields are, well, optional:

 {
  "severity": "ERROR",
  "eventTime": "2017-04-26T02:29:33-04:00",
  "message": "An error just happened!",
  "serviceContext": {
     "service": "robokiller-ivr",
     "version": "1.0"
  },
  "context": {
    "data": {
      "clientIP": "127.0.0.1"
      "userAgent": "Mosaic 1.0"
    },
    "reportLocation": {
      "filePath": "\/Users\/mc\/Documents\/src\/github.com\/macuenca\/apex\/mauricio.go",
      "functionName": "unknown",
      "lineNumber": 15
    }
  },
 "stacktrace": "goroutine 1 [running]:main.main()\n\t\/github.com\/macuenca\/mauricio.go:15 +0x1a9\n"
}

Your Google Console StackDriver Error Reporting may then look something like this:

License

This package is licensed under the BSD 3-clause license.

Opportunities

If you like this project and would like to work on something similar, go check out our Careers page – we’re always looking for talented new people ?

Conclusion

This package has been very helpful to us, so we hope it helps someone else as well. If you have any remarks on the project, please submit a bug or PR ?

#Go logger with #Kubernetes #Stackdriver format compatibility open-sourced by @teltech https://t.co/w1ev6PCf69

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

Books

The Art of Being Brilliant – Andy (Cope & Whittaker)

My favorite quotes from the book The Art of Being Brilliant: Transform Your Life by Doing What Works For You by Andy (Cope &  Whittaker):

Our final thought in this chapter goes to a great quote that seems to sum up a lot of thinking young people nowadays: “The world is passing through troubled times. The young people of today think of nothing but themselves. They have no respect for parents or older people. They are impatient. They talk as if they know everything. And what passes for wisdom with us is foolishness with them. As for the girls; they are forward, immodest and unladylike in speech behavior and dress.”. Hard to disagree. Except that this quotes is from a sermon preached by Peter the Hermit in AD 1274. Seems like young people have always been frowned upon by the older generation. Maybe it’s not the younger generation that needs to change. Maybe it’s up to us to chill out a bit.

A modern prayer (read at a very fast pace ?): “Dear God, help me to slow down and not rush past everything that is important today. Amen.”

10% of life is made up of what happens to you. 90% of life is decided by how you react to the 10%.

  1. Choose to be positive
  2. Understand your impact
  3. Take personal responsibility
  4. Have bouncebackability
  5. Set huge goals
  6. Play to your strengths

The change will not come if we wait for some other person or some other time. We are the ones we’ve been waiting for. We are the change that we seek.

Happy button – don’t wear it out 😉

Failure is only the opportunity to begin again, more intelligently.

Recommended books:

  • The naked leader
  • The naked leader experience
  • S.U.M.O
  • Success intelligence
  • Man’s search for meaning
  • The art of possibility
  • Good to great
  • Average to A+
  • Flourish
  • The Alchemist
  • The monk who sold his Ferrari
  • Do more great work
  • The happiness hypothesis
  • Drop the pink elephant
  • The happiness advantage
  • The pig of happiness
  • The yes man

My #notes from the #book The Art of Being Brilliant by Andy (Cope & Whittaker) https://t.co/qfd6hcLYJ4

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

Miscellaneou$

Ekobit DevArena 2017

TL;DR

In this post, I’ll show you some pictures and notes from the Ekobit DevArena 2017 conference.

Previous conferences

In case you’re interested, here are the posts from the previous three that I attended:

  • DevArena 2016
  • DevArena 2015
  • DevArena 2014

This is how the accreditation looked like on the back side, with the list of presentations per each track (4 in total):

accreditation

Conference oppening

uvod

Awards for fastest signups

This year I got a Kitronik :MOVE mini for BBC micro:bit for making it to the top 10 people who signed up first. Can’t wait to play with this one ?. You can check the other awards here.

nagrada

As always, if you were active on the talks, you could get one of these:

active

Which would then go to the drawing pot, for a chance to win yet another set of great prizes at the end of the conference… 

A great intro presentation by Damir Sabol, the founder of Iskon. Though, you may know him better as the man behind the Microblink company that makes a world know PhotoMath app.

[ngg_images source=”galleries” container_ids=”31″ override_thumbnail_settings=”0″ thumbnail_width=”120″ thumbnail_height=”90″ thumbnail_crop=”1″ images_per_page=”20″ number_of_columns=”0″ ajax_pagination=”0″ show_all_in_lightbox=”0″ use_imagebrowser_effect=”0″ show_slideshow_link=”1″ slideshow_link_text=”[Show as slideshow]” order_by=”sortorder” order_direction=”ASC” returns=”included” maximum_entity_count=”500″ display_type=”photocrati-nextgen_basic_thumbnails”]There were a lot of presentations that covered the ever so slightly eyebrow raising GDPR law ?

[ngg_images source=”galleries” container_ids=”32″ override_thumbnail_settings=”0″ thumbnail_width=”120″ thumbnail_height=”90″ thumbnail_crop=”1″ images_per_page=”20″ number_of_columns=”0″ ajax_pagination=”0″ show_all_in_lightbox=”0″ use_imagebrowser_effect=”0″ show_slideshow_link=”1″ slideshow_link_text=”[Show as slideshow]” order_by=”sortorder” order_direction=”ASC” returns=”included” maximum_entity_count=”500″ display_type=”photocrati-nextgen_basic_thumbnails”]DevOps presentation had a cool intro showing how (fast) Uber solved one problem when Croatian taxi drivers went on strike.

[ngg_images source=”galleries” container_ids=”33″ override_thumbnail_settings=”0″ thumbnail_width=”120″ thumbnail_height=”90″ thumbnail_crop=”1″ images_per_page=”20″ number_of_columns=”0″ ajax_pagination=”0″ show_all_in_lightbox=”0″ use_imagebrowser_effect=”0″ show_slideshow_link=”1″ slideshow_link_text=”[Show as slideshow]” order_by=”sortorder” order_direction=”ASC” returns=”included” maximum_entity_count=”500″ display_type=”photocrati-nextgen_basic_thumbnails”]The discussion on the presentation titled “Worst experiences from working in an agile team” was great with lots of practical input from attendees.

[ngg_images source=”galleries” container_ids=”34″ override_thumbnail_settings=”0″ thumbnail_width=”120″ thumbnail_height=”90″ thumbnail_crop=”1″ images_per_page=”20″ number_of_columns=”0″ ajax_pagination=”0″ show_all_in_lightbox=”0″ use_imagebrowser_effect=”0″ show_slideshow_link=”1″ slideshow_link_text=”[Show as slideshow]” order_by=”sortorder” order_direction=”ASC” returns=”included” maximum_entity_count=”500″ display_type=”photocrati-nextgen_basic_thumbnails”]Challenges of the virtual communication and team work was very valuable for me…

[ngg_images source=”galleries” container_ids=”35″ override_thumbnail_settings=”0″ thumbnail_width=”120″ thumbnail_height=”90″ thumbnail_crop=”1″ images_per_page=”20″ number_of_columns=”0″ ajax_pagination=”0″ show_all_in_lightbox=”0″ use_imagebrowser_effect=”0″ show_slideshow_link=”1″ slideshow_link_text=”[Show as slideshow]” order_by=”sortorder” order_direction=”ASC” returns=”included” maximum_entity_count=”500″ display_type=”photocrati-nextgen_basic_thumbnails”]Standardly awesome Ratko Ćosić was “cooking” this year ?‍?

[ngg_images source=”galleries” container_ids=”36″ override_thumbnail_settings=”0″ thumbnail_width=”120″ thumbnail_height=”90″ thumbnail_crop=”1″ images_per_page=”20″ number_of_columns=”0″ ajax_pagination=”0″ show_all_in_lightbox=”0″ use_imagebrowser_effect=”0″ show_slideshow_link=”1″ slideshow_link_text=”[Show as slideshow]” order_by=”sortorder” order_direction=”ASC” returns=”included” maximum_entity_count=”500″ display_type=”photocrati-nextgen_basic_thumbnails”]All in all, yet another great conference!

Till next time, CODE ON! ?

@DevArena 2017 was great! I got a micro:bit ? ❤️ https://t.co/cBzDjcmWrD

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

Miscellaneou$

How to remove a .DS_Store file from a Git repo on a Mac

This is a quick tip on how to remove the pesky .DS_Store file from a Git repository on a Mac.

Sure, you can just put it in the .gitignore file, but what if you’d like to remove the .DS_Store files from your folders?

Well, just use this one-liner in the command line: find . -name '.DS_Store' -type f -delete.

You can use this for other files as well. For example, you could use find . -name '*.js' -type f -delete to delete all JavaScript files within a containing folder.

Ok, but what if you accidentally added the .DS_Store file to your Git repository? In that case, add the .DS_Store to your .gitignore file, but also execute the following command:

find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch

That’s all, hope this helps!

How to remove a .DS_Store file from a Git repo on a Mac https://t.co/lLM5RqqiO0

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

Books

Extracted – RR Haywood

I don’t read a lot of fiction books, but recently I stumbled upon a fiction book that I liked quite a bit. I don’t have any special quotes from the book Extracted by RR Haywood, as I usually do, but the book itself captivated me quite a bit. I was drawn to the story and listening (Audible ❤️) onward to learn what will happen. This is the first book in the trilogy and I can’t wait to start the second one.

Taken from the official website:

In 2061, a young scientist invents a time machine to fix a tragedy in his past. But his good intentions turn catastrophic when an early test reveals something unexpected: the end of the world.

A desperate plan is formed. Recruit three heroes, ordinary humans capable of extraordinary things, and change the future.

Safa Patel is an elite police officer, on duty when Downing Street comes under terrorist attack. As armed men storm through the breach, she dispatches them all.

‘Mad’ Harry Madden is a legend of the Second World War. Not only did he complete an impossible mission—to plant charges on a heavily defended submarine base—but he also escaped with his life.

Ben Ryder is just an insurance investigator. But as a young man he witnessed a gang assaulting a woman and her child. He went to their rescue, and killed all five.

Can these three heroes, extracted from their timelines at the point of death, save the world?

So, in case you’re into stories which deal with time travel (like I am ?), then you’ll like this one. Oh, btw, in case you know some other book that deals with the similar concept, then please recommend!

#time-travel #books anyone? I liked Extracted by RR Haywood https://t.co/RTOiv2t45C

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

Books

Doing Good Better: How Effective Altruism Can Help You Make a Difference

My favorite quotes from the book Doing Good Better by William MacAskill:

The money is less valuable to you, the more you have of it.

The challenge for us is this: How can we ensure that, when we try to help others, we do so as effectively as possible?

If you make more then 52k$/year you’re in the top 1% of the world’s population in terms of income. If you make more than 28k$/year you’re in the 5% richest people in the world. 11k$/year you’re richer than 85% of the people. Let that sink in.

When thinking about risk from transport, you can think directly in terms of minutes of life lost per hour of travel. Each time you travel, you face a slight risk of getting into a fatal accident, but the chance of getting into a fatal accident varies dramatically depending on the mode of transport. For example, the risk of a fatal car crash while driving for an hour is about one in ten million (so 0.1 micromorts). For a twenty-year-old, that’s a one-in-ten-million chance of losing sixty years. The expected life lost from driving for one hour is therefore three minutes. Looking at expected minutes lost shows just how great a discrepancy there is between risks from different sorts of transport. Whereas an hour on a train costs you only twenty expected seconds of life, an hour on a motorbike costs you an expected three hours and forty-five minutes. In addition to giving us a way to compare the risks of different activities, the concept of expected value helps us choose which risks are worth taking. Would you be willing to spend an hour on a motorbike if it was perfectly safe but caused you to be unconscious later for three hours and forty-five minutes? If your answer is no, but you’re otherwise happy to ride motorbikes in your day-to-day life, you’re probably not fully appreciating the risk of death. Boy, do I love that my parents didn’t give in to my ‘motorbike desire’ way back as a teenager ❤️

We’re about one hundred times richer than the poorest billion people in the world, and we can do several hundred times more to help them than we can to help others in the rich countries we live in.

Page 15 of 51« First...10«14151617»203040...Last »

Recent posts

  • Discipline is also a talent
  • Play for the fun of it
  • The importance of failing
  • A fresh start
  • Perseverance

Categories

  • Android (3)
  • Books (114)
    • Programming (22)
  • CodeProject (35)
  • Daily Thoughts (77)
  • Go (3)
  • iOS (5)
  • JavaScript (127)
    • Angular (4)
    • Angular 2 (3)
    • Ionic (61)
    • Ionic2 (2)
    • Ionic3 (8)
    • MEAN (3)
    • NodeJS (27)
    • Phaser (1)
    • React (1)
    • Three.js (1)
    • Vue.js (2)
  • Leadership (1)
  • Meetups (8)
  • Miscellaneou$ (77)
    • Breaking News (8)
    • CodeSchool (2)
    • Hacker Games (3)
    • Pluralsight (7)
    • Projects (2)
    • Sublime Text (2)
  • PHP (6)
  • Quick tips (40)
  • Servers (8)
    • Heroku (1)
    • Linux (3)
  • Stack Overflow (81)
  • Unity3D (9)
  • 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