AppleScript: Return name of current item playing in VLC

if application "VLC" is running then
    tell application "VLC"
        if playing then
            return name of current item
            return "No track playing"
        end if
    end tell
    return "VLC not running"
end if

PowerShell: Output Windows Services to JSON file

A simple one-liner for outputting Windows Service properties to a JSON file.

Get-Service * | ConvertTo-Json | Out-File services.json

And here are some approaches for getting string representations of the enum integers:
[Stack Overflow] Powershell – Retain Complex objects with ConvertTo-Json


Alternative command using Get-WmiObject — this doesn’t require any enum serialisation workarounds:

Get-WmiObject win32_service | ConvertTo-Json > services.json

Guide: Tracking a UK Postal Order

As of April 2018, the telephone option information is no longer valid.
Thanks go to Simon for letting me know about this.

Every attempt has been made to ensure the accuracy and reliability of the information provided here. However, the information is provided “as is” without warranty of any kind. This information is current of 23 February 2015 and is subject to change. I have no affiliated with, nor do I represent the Post Office.

Here is how I contacted the Post Office by telephone to trace a UK postal order.
First-off: call the Post Office on 03457 22 33 44.

When presented with the menu press the following options to make a postal order tracking enquiry:

5 -> Other

6 – Other

2 – Other

2 – Other

Have your 10-digit Voucher ID ready.

For obtaining written evidence of a payment, you may write to:

Postal Order Correspondence Section
Post Office Ltd
1 Future Walk
S49 1PF

Accessing MAMP MySQL terminal

For accessing the MAMP MySQL via the terminal in OS X, entering the mysql command may result in this error:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

To solve this, simply provide the path to the correct .sock file

$ mysql --socket=/Applications/MAMP/tmp/mysql/mysql.sock --user=username --password=password

More info:
Solve: Can’t connect to local MySQL server through socket /tmp/mysql.sock [Tech-Recipes]

Overriding apex:barSeries renderer in VisualForce

Here’s the method signature for overriding the apex:barSeries render, simply add rendererFn=”barSeriesRenderer”:

function barSeriesRenderer(sprite, record, attributes, index, store) {
// console.log(attributes);
attributes.height = 15;
return attributes;

Powershell: Determine which process is using a port

1. Simple (dumb) search for port number


PS C:\> netstat -ano | Select-String "8080"

Example Result

TCP [::]:8181 [::]:0 LISTENING 9508

2. Get Process Name by Id


PS C:\> Get-Process -Id 9508

Example Result

Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
------- ------ ----- ----- ----- ------ -- -----------
1326 580 421440 356072 1065 52.88 9508 java

[Optional]3. Stop Process


PS C:\> Stop-Process 9508

Football World Cup 2014 – Twitter flag hashtags

For the Football World Cup 2014, Twitter will display a flag emoticon if you use an appropriate ISO 3166-1 alpha-3 country code. Only the countries of teams participating in the tournament are currently supported. Who knows, Twitter may decide to extend the codes to include all recognised ISO 3166-1 countries.

Flag Country Twitter Hashtag
Algeria #ALG
Argentina #ARG
Australia #AUS
Belgium #BEL
Bos-Herce #BIH
Brazil #BRZ
Cameroon #CMR
Chile #CHI
Colombia #COL
Costa Rica #CRC
Croatia #CRO
Ecuador #ECU
England #ENG
France #FRA
Germany #GER
Ghana #GHA
Greece #GRE
Honduras #HON
Iran #IRN
Italy #ITA
Ivory Coast #CIV
Japan #JPN
Mexico #MEX
Netherlands #NED
Nigeria #NGA
Portugal #POR
Russia #RUS
South Korea #KOR
Spain #SPA
Switzerland #SWI
Uruguay #URU
United States of America #USA