My first Google Chrome Extension

I’ve been looking for a reason to create a Google Chrome Web Browser extension for a long time now, and today I finally decided to do it.

I wrote a PHP script a while ago to help grab videos link off various websites. Particularly FLV files. I wrote the PHP script because I got tired of getting the FLV in the page source code every time. It was however a schlep to copy & paste the URL every time and then get the links. So it was time to make it more efficient.

I decided to make it a Chrome browser extension.

My first stop was http://code.google.com/chrome/extensions/index.html and from the beginning it was evident it was going to be quite a learning curve.

I checked through the examples, made offline copies and started playing around with the code. It primarily makes use of Javascript and HTML to accomplish what you need done. I normally try and stay away from Javascript, but this forced me to go against it and play around with client side coding.

There were a few snags along the line, but let’s first look at what the extension does.

How this script works:
1. Once installed, you will have an icon on your toolbar
2. When you click on it, it reads the current page’s HTML into memory
3. By making use of regular expressions it gets all the mentions of FLV files
4. It places them nicely one link per line in a popup window
5. You simply click on the link and it opens a new tab with your video there

I had a look at a number of extensions, and it seems everyone does things differently. The part that I struggled with most was getting the content of the current HTML page into memory so that the popup script could use it. I thought it would’ve been easier to figure it out, but nothing worth anything in life comes easy. Once I figured that out it was simply a matter of putting a few finishing touches on there.

I’ve uploaded it onto Google Chrome Extension Directory to get other people to test it as well and give feedback. If you happen to test it and you find a bug, please let me know.

Bookmark and Share

Self Defense with Rope Fighting

Practical Applications of Filipino/Indonesian Rope Fighting

I found this nice video clip about using a simple rope as a self defense weapon. See how easy it is to eliminate the use of your attacker’s hands by making use of a piece of rope you can carry around in you pocket.

Bookmark and Share

Better living through meditation

Today’s life has become so fast paced and so busy that I’m willing to put money on the fact that you cannot go 1 hour being around people and not hear at least one person say how busy their life is, or how stressed out they are.

Our stress and tiredness make us feel unhappy, impatient and frustrated. Combine this with the feeling of not having enough hours in a day and you’re a ticking time bomb.

You need to stop and get some quiet time for yourself. This is where meditation comes into the picture. Meditation is not about opening yourself up to evil spirits or praying to a god. It’s about taking time for yourself to make your mind calmer and more focused. You also don’t need to become a Zen master in order to appreciate meditation, because it’s a lot easier than most people think.

A simple ten minute breathing meditation will help you overcome stress and help you on your journey to find inner peace. Using meditation you can become familiar with your own mind and start understanding it. That sounds like a funny thing to say, but how often have you thought to yourself “Who am I?”.

Using meditation you can transform your negative mind to positive and take the un out of the unhappiness.

Here is a guide to a simple breathing meditation:

1. Choose a quiet place to go and sit

Make sure any distractions are switched off. TV, radio, cellphone, etc. The more you do this, the less any distractions will really make a difference.

2. Sit in a comfortable position

The best is to sit in a cross legged position, as you’ll get the most benefit out of your meditation from this position. You’re opening up all your energy points in your body as well as creating an energy force around you. You can even sit on a chair if you want to, just as long as your are comfortable. Try to keep your back straight, as this prevents your mind from becoming sleepy.

3. Close your eyes and listen to your breathing

While sitting, slowly close your eyes. Start focusing on your breathing. Breathing through your nose, do not attempt to control your breathing. Feel the sensation in your nostrils and throat, listen to it as your breath in and out.

4. Keep focusing on your breathing

This is the focus of this meditation. By focusing on your breath, you are getting your mind off other things that are bothering you in your life. Don’t worry if other thoughts come into your mind, just refocus on your breath.

You do this for as long as you feel comfortable doing it. The more you do it, the easier it will become to focus your mind and stop it from drifting off. Do it whenever you feel like you need it, your body will tell you when it’s time.

This is a very basic form of meditation, and perhaps it’s all you need. I’ve found some nice Youtube videos and documents about the different meditation forms.

If you’re interested, below are 6 videos you might want to watch.

How to meditate – Introduction

How to meditate – Part 1

How to meditate – Part 2

How to meditate – Part 3

How to meditate – Part 4

How to meditate – Part 5

Bookmark and Share

Dodging Telkom Surveys

Here’s a tip for anyone that gets a phone call from Telkom to do a survey. Actually, I’ve found this works for most survey companies, i.e. motor dealership satisfaction surveys.

The first tip is to just say, “Not interested” and hang up, but that puts you in the position of being rude to another person when it’s not their fault for phoning you.

The alternative is just to say “Hello. Sure I’ll take the survey”. They start the questions by asking if you’ve taken the survey in the last 3 months. Just answer, “Yes”, and they’ll tell you that you cannot take part in the survey then. Then… it’s over :)

You weren’t rude, and it still only take 5 seconds out of your life.

Bookmark and Share

Animal Attraction

Any humans thought they had it difficult!

Bookmark and Share
←Older