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

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