Skip to content

podcast

How to Customize Sublime Text's Default Auto-Complete

Welcome back to another episode of Continuous Improvement, the show where we explore ways to enhance our productivity and streamline our workflows. I'm your host, Victor, and today we'll be focusing on a common issue faced by many Sublime Text 3 users.

As someone who uses Sublime Text 3 every day, I can definitely relate to the frustrations we encounter when certain features don't work as expected. One particular annoyance that I've come across is the default auto-complete for if statements. It adds an unnecessary semicolon at the end, causing issues when using tools like JSHint.

But fear not, my fellow developers, for today I bring you a simple solution to this problem. Let's dive right into it!

The first step is to open Sublime Text's preferences. You can do this by navigating to Preferences and selecting Browse Packages. This will open the Sublime Text folder where we'll make the necessary changes.

Once you're in the Sublime Text folder, locate the folder named JavaScript. If you can't find it, don't worry! Simply create a new folder and name it JavaScript.

Now that we have the JavaScript folder open, we need to modify the if.sublime-snippet file. This file controls the auto-completion behavior for if statements.

Open the if.sublime-snippet file, or if it doesn't exist, create a new one with that exact name. This file is written in XML, and we need to make a small adjustment to remove the semicolon.

Let's take a look at the original code snippet. It looks like this:

<snippet>
    <content><![CDATA[if (${1:true}) {${0:$TM_SELECTED_TEXT}}]]></content>
    <tabTrigger>if</tabTrigger>
    <scope>source.js</scope>
    <description>if</description>
</snippet>

As you can see, the issue lies in the unnecessary semicolon at the end:

<content><![CDATA[if (${1:true}) {${0:$TM_SELECTED_TEXT}}]]></content>

To solve this problem, simply remove the semicolon so that the snippet now looks like this:

<snippet>
    <content><![CDATA[if (${1:true}) {${0:$TM_SELECTED_TEXT}}]]></content>
    <tabTrigger>if</tabTrigger>
    <scope>source.js</scope>
    <description>if</description>
</snippet>

By following these simple steps, you'll be able to eliminate the annoying semicolon and improve your coding process. No more manually deleting it every time you write an if statement!

And there you have it, folks! An easy and effective solution to the Sublime Text auto-complete issue. I hope this tip brings you one step closer to an optimized workflow.

As always, remember that continuous improvement is key. If you have any other challenges or suggestions for future episodes, feel free to reach out to me on Twitter @VictorCI.

Thank you for tuning in to Continuous Improvement, the podcast that helps you level up your productivity. Stay tuned for more exciting tips, tricks, and hacks in our upcoming episodes.

Until next time, keep coding, keep improving, and stay productive!

Build an Awesome Chat App in 5 Minutes with Meteor

Welcome back to Continuous Improvement, the podcast where we explore tools and techniques for enhancing our skills and knowledge in the world of software development. I'm your host, Victor. In today's episode, we're going to dive into the world of real-time application development using MeteorJS. So if you've ever wanted to create a chat application, this episode is for you.

Before we get started, make sure to check out the live demo and the source code on GitHub. The live demo is available at hrr2demo.meteor.com, and the source code can be found at github.com/victorleungtw/hrr2demo. Feel free to try the demo and fork the repository so you can follow along with the tutorial.

Alright, let's jump right into it. The first step is to install Meteor on your machine. If you're on macOS or Linux, simply open your terminal and run the command:

curl install.meteor.com | sh

Once Meteor is successfully installed, we can proceed to create our chat application. Open your terminal and run the following command:

meteor create awesomeChatApp

This will create a new Meteor application with the name "awesomeChatApp". Change your directory to the app by running:

cd awesomeChatApp

Great! Now let's try running our app by executing:

meteor

This command will start the Meteor server, and you can see your app in action by opening your browser and visiting localhost:3000.

Now that we have our application set up, let's move on to organizing our code. We're going to create three folders - client, server, and both.

In the client folder, we'll place anything that runs on the client side, which is the user's browser. In the server folder, we'll place anything that runs on the server side. And in the both folder, we'll put code that is used by both the client and server.

Next, we'll create a model to store our chat messages. Inside the both folder, create a file called "collection.js". In this file, we'll define a new Meteor collection called "Messages". Here's the code:

Messages = new Meteor.Collection('messages');

Moving on, let's create the index page where our chat application will be displayed. Inside the client folder, create a file named "index.html". In this file, we'll write our HTML code for the homepage view. Here's an example:

<head>
  <title>chatterbox</title>
</head>
<body>
  {{> loginButtons align="right"}}
  # chatterbox
  {{> input}} {{> messages}}
</body>

As you can see, we're using the Meteor templating system to include other templates such as the "loginButtons", "input", and "messages" templates.

Speaking of the messages template, let's create it now. Inside the client folder, create a folder called "messages". Within that folder, create a file named "messages.html". In this file, we'll define the structure of our chat messages. Here's the code:

<template name="messages">
  {{#each messages}}
    {{name}}:  {{message}}
  {{/each}}
</template>

We also need to create some helper functions to loop through each message in the Messages collection and display them. To do this, create a file named "messages.js" inside the messages folder. Here's an example of the code:

Template.messages.helpers({
  messages: function() {
    return Messages.find({}, { sort: { time: -1 } });
  }
});

Now that our messages template is ready, let's move on to creating the input template. Inside the client folder, create a folder called "input". Within that folder, create a file named "input.html". In this file, we'll define the HTML structure for the chat input box and submit button. Here's an example:

<template name="input">
  <form id="send">
    <input id="message" type="text">
    <input type="submit" value="Submit">
  </form>
</template>

We'll also need to handle the submit event of the form in order to insert a new message into the Messages collection. Create a file named "input.js" inside the input folder. Here's an example of the code:

Template.input.events({
  'submit form': function(event) {
    event.preventDefault();
    var name = Meteor.user() ? Meteor.user().profile.name : 'Anonymous';
    var message = document.getElementById('message');
    if (message.value !== '') {
      Messages.insert({
        name: name,
        message: message.value,
        time: Date.now()
      });
      message.value = '';
    }
  }
});

Now that our chat application is taking shape, let's add a login system using the GitHub authentication method. Meteor makes it easy to add user authentication with its packages. We'll need to add two packages to our application. In your terminal, run the following commands:

meteor add accounts-ui
meteor add accounts-github

With these packages added, the login buttons will automatically appear on our index page, allowing users to authenticate using their GitHub accounts.

Finally, if you want to add some style to your application, create a new folder named "style" inside the client folder. Within the style folder, create a file called "style.css" and add your CSS styles to customize the look and feel of your chat application.

Alright, we've covered a lot in this episode. We've created a chat application using MeteorJS, organized our code into different folders, implemented a messages template to display the chat messages, added an input template with event handlers for submitting new messages, and even integrated a login system using the GitHub authentication method.

If you're ready to take your chat application to the next level, don't forget to deploy it to Meteor's free server. Simply run the command "meteor deploy yourAppName.meteor.com", and your application will be accessible online.

That's it for today's episode of Continuous Improvement. I hope you found this tutorial helpful in your journey towards becoming a better software developer. As always, keep learning and keep improving. This is Victor signing off!

Fun Facts I Discovered in Melbourne

Welcome, listeners, to another episode of Continuous Improvement, the podcast dedicated to exploring different aspects of personal growth and exploration. I'm your host, Victor, and today we're going to dive into a lighthearted topic that has sparked endless debates: Sydney versus Melbourne. Now, I know this rivalry might seem petty, but hey, sometimes it's fun to compare apples to oranges. And in my opinion, Melbourne takes the cake. Sorry, Sydney.

So let me share with you a personal experience that solidified my love for Melbourne. It was a rainy weekend in July, but that didn't dampen my spirits. I decided to visit my best friend in Melbourne without any specific plans in mind. And let me tell you, one visit to this city is never enough to truly experience everything it has to offer.

Let's start with the weather. Melbourne's winter is no joke. Coming from sunny Brisbane, I was caught off guard by the unique kind of cold that Melbourne offers. But hey, it had its perks. At night, I could enjoy an uninterrupted stroll down the street while savoring a delicious ice cream that miraculously didn't melt in my hands.

Now, Melbourne's architecture is something special. Getting lost in the city is almost a rite of passage for newcomers, especially when you encounter the infamous "Pie Face" on almost every street. But fear not, because most tourist attractions conveniently cluster around the city center. I'm talking about iconic landmarks like Flinders Street Station, the Queen Victoria Market, and the imposing State Library of Victoria, all within walking distance or a free ride on the city circle tram.

Art enthusiasts will find plenty to satisfy their cultural cravings at Federation Square. Just a word of caution, though: not all art galleries in Melbourne are free. Trust me, we learned this the hard way, but the contemporary art we stumbled upon was well worth the entrance fee.

Now, let's talk about a hidden gem, the aquarium. This might not be the most popular tourist attraction in the city, but for animal enthusiasts like myself, it offers a captivating experience. And let me assure you, the penguins in Melbourne's aquarium have quite the spitting skills! But hey, their greenish hue is caused by bile, and believe it or not, scientists even use satellite imagery to estimate the number of emperor penguins based on the spots of their excrement. Fascinating, right?

Now, there's something about Chinatown in Melbourne that sets it apart. It's not just one bustling area; Chinatown seems to be everywhere in the city. With such diverse cultural influences, it's no surprise that Melbourne proudly embraces its international blend. And brace yourselves, because you might stumble upon a Chinese restaurant sign that translates to "Hot and Lust." Trust me, it's not a brothel, just an interesting translation!

And last but not least, let's not forget the famous Twelve Apostles. Well, despite the name, it turns out there aren't twelve stacks or any biblical connection to this natural wonder. Nevertheless, the Great Ocean Road leading to the Twelve Apostles is an absolute must-visit. The breathtaking views along the winding road are simply unforgettable. Just make sure to pray for good weather if you plan a day trip to this popular tourist site.

So there you have it, listeners. Melbourne, with its vibrant culture, unique weather, and endless attractions, has truly won my heart. Whether you're planning your first visit or considering a return trip, Melbourne promises a memorable experience that keeps on evolving with each season.

That's all the time we have for today's episode. I hope you enjoyed our exploration of Sydney versus Melbourne, and if you're Team Melbourne like me, don't hesitate to spread the word. Remember, it's all about continuous improvement, and sometimes that even means discovering new cities and embracing new experiences.

Thank you for tuning in to Continuous Improvement. I'm your host, Victor, and until next time, keep seeking new adventures and embracing personal growth. Goodbye!

[END OF EPISODE]

Things I Love and Hate About Hong Kong

(Intro) Welcome back to Continuous Improvement, the podcast where we explore personal growth and self-reflection. I'm your host, Victor, and today we're going to dive deep into the complexities of love and hate for our beloved city, Hong Kong.

(Segment 1 - Love: Diversity of People) Let's kick things off with the positives. One thing that never fails to fascinate me about Hong Kong is the diversity of its people. With a rich mix of cultures and backgrounds, this city truly is a melting pot. It's been a hub for tourists exploring China for decades, and even now, with more opportunities to visit China directly, Hong Kong retains its unique atmosphere. The hardworking and efficient nature of the people here creates an electrifying energy that I find invigorating. The fast-paced lifestyle is almost addictive, and whenever I travel abroad, the slower pace always drives me crazy.

(Segment 2 - Hate: Overcrowding) But, of course, nothing is perfect, and Hong Kong has its downsides. The most glaring issue, in my opinion, is overcrowding. From buying tickets to catching a train or finding a table at a restaurant, there always seems to be a long queue wherever you go. The city feels like it's bursting at the seams, and that constant stress can be suffocating. It's a side of Hong Kong that I absolutely despise.

(Segment 3 - Love: Food) Now, let's move on to something everyone can appreciate - the food. Hong Kong never disappoints when it comes to culinary delights. The variety and quality of food is truly astounding. From Chinese roasted pork to Taiwanese bubble tea, and from Japanese sushi to Korean BBQ, Hong Kong is undoubtedly a food paradise. The joy of eating is something that brings people from all walks of life together.

(Segment 4 - Hate: High Cost of Living) However, amidst all the culinary pleasures, there's a significant downside - the high cost of living. The more convenient the location, the higher the price tags. Locals often lament the fact that Hong Kong has some of the world's highest rents for the smallest living spaces. And to add insult to injury, the prices keep rising. It's a challenge that many Hong Kong residents face and a major point of contention.

(Segment 5 - Love: Happy Memories) Now, shifting gears, one of my favorite aspects of Hong Kong is the nostalgia it holds for me. I had an incredible childhood here, and there's something truly special about the memories this city holds. It's a place that I wish I could have captured better at the time, especially with the technology we have today. Those memories are the foundation of my love for Hong Kong.

(Segment 6 - Hate: Political Climate) However, it's important to address another aspect that influences my relationship with this city - the political climate. The influence of the communist party on this once-vibrant city has had a significant impact. The control over media, education, and legislative systems is concerning. The lack of democracy and suppression of free speech are issues that I deeply resent. It's disheartening to witness the changes in Hong Kong's political landscape over the years.

(Conclusion) In conclusion, my relationship with Hong Kong is complex, filled with both love and frustration. The overcrowding, high cost of living, and political strife are undoubtedly difficult to deal with. But it's the memories, the food, and the diversity of people that keep me attached to this city. Despite its flaws, Hong Kong holds a special place in my heart - a place of nostalgia and connection.

(Outro) Thank you for joining me on this journey of exploring the complexities of Hong Kong. Remember, life is all about continuous improvement, and understanding our relationships with the places we call home is an important part of that process. Until next time, this is Victor signing off. Take care, and keep striving for growth.

How to Visit Sydney in 3 Days When You're Short on Time

Welcome, welcome, welcome! You're listening to "Continuous Improvement," the podcast where we explore strategies and tips to level up your life. I'm your host, Victor, and today we're diving into a topic that's perfect for all you adventure-seekers and time-limited travelers out there. We're talking about how to make the most of your three-day trip to the vibrant city of Sydney! So, let's get started.

Now, I know what you're thinking. How on earth can you possibly experience all that Sydney has to offer in just three days? Well, fear not, my friends, because with a little guidance, you'll be able to explore the essentials and have a memorable experience. So, let's jump right into it.

To kickstart your Sydney journey, there's one iconic landmark you simply cannot miss: the Opera House. The perfect spot for a memorable selfie and jaw-dropping views is the Sydney Ferris Wheel. Plus, it's a more budget-friendly option compared to climbing the Harbour Bridge. Trust me, the views from up there are absolutely breathtaking!

After capturing the perfect Instagram-worthy moments, it's time to take a leisurely stroll in The Rocks area. Treat yourself to a delightful meal at Pancakes on the Rocks or indulge in some delicious fish and chips at one of Glebe's fish markets. And if you happen to be in Sydney over the weekend, The Rocks Market is a must-visit. You'll find a variety of interesting vendors, local artisans, and live music—be prepared though, your wallet might get a little lighter!

Now, let's talk culture. Sydney is home to numerous museums and art galleries that offer a wealth of knowledge and fascinating exhibits. The best part? Many of them have free entry! Make sure to visit the Australian Museum, the Art Gallery of NSW, The Rocks Discovery Museum, the Powerhouse Museum, and the Australian National Maritime Museum. You'll be amazed at the history and artwork waiting to be discovered.

Next up, we have Darling Harbour—a must-visit destination for anyone coming to Sydney. On Saturday nights, you'll be treated to a spectacular display of fireworks, alongside attractions like Madame Tussauds and the aquarium. And if you're up for it, head to the IMAX theatre with its world's largest screen. Just make sure to choose a film that's worth the scale! Don't forget to indulge in some heavenly treats at the Lindt Chocolate Café and Hurricane—it's like a little slice of paradise.

Now, no visit to Sydney would be complete without experiencing its famous beaches. Bondi, Manly, Coogee, Bronte, and Maroubra are all worth a visit. Picture beautiful, clean beaches with soft sand—perfect for sunbathing and people-watching. And let's be honest, you'll see some eye-catching swimwear while you're there!

Are you an ice cream enthusiast like me? Well, Newtown is the place to be. This vibrant neighborhood offers some of the world's most exquisite gelato. One of my personal favorites is Cow and the Moon—where they serve up unique and delicious flavors. But be prepared for a bit of a wait and a bit of a struggle to find a seat. Trust me though, it's absolutely worth it! You'll become an instant fan.

And there you have it, my fellow wanderlusters! These activities and destinations are a true taste of what Sydney has to offer in just three days. Remember, with a little determination, an early start, and some help from good old Google Maps, you can truly immerse yourself in an authentic Sydney experience.

That's all we have for today on "Continuous Improvement." I hope you found these tips helpful and inspiring. Join me next time as we explore more ways to level up your life. Until then, keep striving for continuous improvement!

Reasons Why You Should Travel to Brisbane

Welcome back to another episode of "Continuous Improvement." I'm your host, Victor, and today we're diving into the wonderful city of Brisbane. If you're looking for a destination that combines friendly people, stunning surroundings, and affordable travel, then Brisbane is the place to be. Trust me, I've spent a considerable amount of time there, and I can't wait to share my experiences with you. So let's get started!

First and foremost, the people in Brisbane are simply incredible. The locals are warm, kind, and always ready to greet you with a smile. In fact, I have more friends from Brisbane on my Facebook friend list than from my own country! The hospitality here is unparalleled, and you'll have the chance to make friends from all over the world. So if you're a fan of meeting incredible people, Brisbane is the perfect destination.

Now, let's talk about something that makes Brisbane truly unique - the beaches and islands. I'm not exaggerating when I say that you'll find a slice of heaven on Earth here. Surfers Paradise, just an hour's drive from the city, might not be the best beach, but it's certainly one of the most popular. And if you're up for an adventure, be sure to visit Moreton Island, the world's third-largest sand island. Snorkeling around the shipwrecks there is an unforgettable experience. But if you prefer a more laid-back beach day, you'll love South Bank Street Beach, right in the heart of the city. Just don't forget your sunscreen!

Another reason why Brisbane should be on your travel radar is the climate and weather. With an average temperature of 26.6 degrees Celsius throughout the year, any time is a delightful time to visit. While Europe may be shivering in sub-zero temperatures, Brisbane is enjoying warmth and sunshine. It's simply paradise for those who appreciate a pleasant climate.

Now, let's satisfy our taste buds. Dining out in Brisbane is a unique experience, especially for Asian food enthusiasts like myself. Make sure to visit Sunnybank, a gastronomic paradise featuring incredible dim sum, smoked pork, and bubble tea. There are also must-try restaurants like Little Lamb Happy Ranch, Madtongsan, and Pancake Manor. Brisbane's food scene will leave you craving more.

Moving on to festivals and culture, Brisbane has so much to offer. Explore the city's Cultural Precinct on the South Bank, where you'll find the Queensland Museum, Queensland Art Galleries, Gallery of Modern Art, Queensland Performing Arts Centre, and the Science Centre. And if you happen to be in town during specific times of the year, you'll have the chance to experience incredible events like the Brisbane Festival, Spring Flare Festivals, Oktoberfest, and unforgettable New Year's Eve celebrations. Trust me, you'll never be bored in Brisbane!

Brisbane also promotes a healthy way of life. While there might not be traditional tourist attractions to promote it, you can explore the city like a local. Try kayaking on the Brisbane River at Riverlife for a unique experience. Not a fan of water sports? No worries! You can always choose to go on Segway tours, cycling adventures, or even try your hand at rock climbing in Kangaroo Point. Embrace the adventure and push your limits with skilled instructors guiding you every step of the way.

So, there you have it, my friends. Brisbane is an incredible city that offers an unforgettable experience. Whether you want to meet incredible people, soak up the sun on stunning beaches, indulge in a diverse food scene, immerse yourself in festivals and culture, or embrace a healthy and active lifestyle, Brisbane has it all. I've had the pleasure of spending a significant amount of time in this amazing city, and believe me when I say that it's worth visiting at least once in your lifetime.

Well, that brings us to the end of today's episode of "Continuous Improvement." I hope you enjoyed our exploration of Brisbane, and maybe it has even inspired you to plan your next trip there. Remember, continuous improvement is not just about personal growth, but also about exploring new places and embracing new experiences. Until next time, keep striving for greatness. I'm Victor, signing off.