Skip to main content

Posts

Showing posts from 2013

Convert Font Suitcase to TTF

Sometimes clients send me fonts in Font Suitcase format, and  I'm suppose to include the fonts in their websites.

To convert the fonts to TTF, I use Fondu.
A set of programs to interconvert between mac font formats and pfb, ttf, otf and bdf files on unix. Fondu will read a series of mac files, check their resource forks and extract all font related items into seperate files.
Install Fondu (OSX) Download FonduOpen terminalChange directory to the dir that you extracted fondu interminal: ./configureterminal: maketerminal: sudo make install
Convert Fonts to TTF
Change directory to the dir where your font is.terminal: fondu <font filename>
e.g. fondu Futura.dfontDone.
Convert to Webfonts Upload the converted .ttf file to http://convertfonts.com/





Related:
http://apple.stackexchange.com/questions/8455/how-do-i-convert-a-suitcase-font

Free Skype Premium For a year (€71,88 value)

Steps to Redeem the Voucher

Go to https://collaboration.skype.com/promotion/ and sign up.You’ll receive a voucher code in your email shortly after that.Go to http://skype.com/go/voucher, and enter your voucher coupon code. Enjoy your Skype premium credits for free!
Share it with your friends!



----------


Side note:
There are lots of voucher/deal promotions spreading around this season. Do take note on the URL links before you click them. Do not fall into the trap of phishing sites.

Make sure the links are indeed the original websites. In this case, it should be from skype.com, i.e.   https://collaboration.skype.com/promotion/.

And the email that you'll be receiving should be something like this:


And the links are indeed redirect to skype.com.

Happy Holiday! :)

Instagram Accounts (Non-celebrities) with more than 1 Million Views

I'm consolidating the list of Instagram accounts (non-celebrities) with more than 1 million followers.

1. @ahlamalnajdi (1,138,847 Followers)




Comparison:

@instagram (53,262,825)@justinbieber (12,064,220)@arianagrande (8,149,691)@taylorswift (7,190,340)@starbucks (1,825,637)


Feel free to let me know on any non-celebrities accounts with 1 million views.

Gmail show wrong timezone for emails

This is just a self reminder.

Gmail list out email timezone according to computer system clock.

If the time displayed on your messages is wrong, your system clock may be set incorrectly. To check your system clock, do the following: Open your computer’s date and time settings.Verify that the appropriate month, day, and year are selected.Verify that your time zone is selected. If you changed your time zone, restart your browser.
Source:
https://support.google.com/mail/answer/7992?hl=en

[Apache AccessLog] %2f..%2f..%2f..%2fetc%2fhttpd%2flogs%2ferror.log

Recently reviewed the Apache Accesslog for one of the sites I'm handling.

Got a bunch of entries in my access log that looks like these
54.208.35.151 - - [27/Nov/2013:13:27:58 +0800] "GET /wp-content/plugins/theia-post-slider/js/balupton-history.js/history.js?ver=..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2fetc%2fhttpd%2flogs%2ferror.log HTTP/1.1" 404 - "http://[this-is-intentionally-masked].com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; ScanToSecure)" or
54.208.35.151 - - [27/Nov/2013:13:30:11 +0800] "GET /wp-content/plugins/sociable/css/sociable.css?ver=..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2fvar%2flog%2fapache%2ferror.log HTTP/1.1" 200 5687 "http://[this-is-intentionally-masked].com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; ScanToSecure)" Notice that the second example is actually a HTTP 200 OK status request. Meaning the request is va…

Liquid Cooling using 3M™ Novec 7000

Liquid Cooling experiment by Corvalent Corp
From the video description:
This is a video of an engineering experiment we conducted cooling a computer by completely submerging it in liquid. This liquid submersion cooling system is NOT using mineral oil, or any type of oil cooling. This experiment was done using a chemical made by 3M called Novec™ 7000. It has a low boiling point, and leaves no residue or any trace whatsoever behind on the motherboard. The board was equipped with an i3 processor, running at 100% load. 
3M™ Novec™ 7000 Engineered  Fluid
The "magic" behind this is the 3M™ Novec™ 7000 Engineered  Fluid.

The liquid has low boiling point, low-toxicity, is 100% Ozone safe, and is used as heat transfer fluid for cooling reactors in pharmaceutical & chemical processing.

The best property about this liquid is because its non conductive, you can have total immersion cooling system.

No heat sink on all the chips. No water pump or radiator required at all.

The water c…

My Thoughts on The Volvo Truck Advertisement Series

I was quite amazed by the Volvo advertisements that gone viral on all social media. If you haven't watch the videos, scroll to the bottom of the post and watch 'em all.

As what the president of Volvo Trucks, Claes Nilsson mentioned it (in "Live Test 4"):
I've learned that when you want to make a YouTube hit, you need the hook at the beginning of the film. And here it is.
I think the Volvo Truck advertisements were brilliantly executed.



Overall Statistics


These are the statistics I compiled from Youtube. As of 16 Nov, the only available stats are until 14th Nov.
Note: On 16th Nov, "Live Test 6" already have 13,105,012 views.





As of November 14 2013


Volvo Truck subscribers: 34,385.
Total subscription from 6 Videos: 4,062.
% new subscribers from all videos: 11.81%


The most successful video


Among these video, the most successful one is The Epic Split feat. Van Damme (Live Test 6)


This video has 32,176 shares (0.49% share rate),
and contributed to 1,987 new subscr…

225019099301.apps.googleusercontent.com

Recent activity on my Gmail just revealed that there's this app "Authorized Application (225019099301.apps.googleusercontent.com)" from IP address 54.235.159.144 assessing my Gmail.

The IP address is from a Amazon server ec2-54-235-159-144.compute-1.amazonaws.com. (IP Lookup).

And blacklist check (http://whatismyipaddress.com/blacklist-check) shows that the IP is clean too.

Clicking on the "Manage Account Access" didn't give any information on the application "225019099301.apps.googleusercontent.com".


After Googling, it appears that the app is Mailbox (source: http://productforums.google.com/forum/#!topic/gmail/9LVW_etXyTE)

To make things easy, Google should show the applications with their ID.


[Azure Websites PHP] Cross Domain request results in blank response page after Preflight HTTP OPTIONS

THE PROBLEM

I've deployed a REST API application (CodeIgniter with Phil Sturgeon's Rest-Server library) on Azure Websites.

Although I've set the Access-Control-* header in my PHP application:
header('Access-Control-Allow-Credentials: true');
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST, DELETE, OPTIONS');
header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept');
(If you need a working test file, here's the gist for the test file)

But Azure Websites server doesn't return the headers in response.

And thus all requests to the server failed with the error message:
Origin http://example.azurewebsites.net is not allowed by Access-Control-Allow-Origin. In order to make sure there's no problem with my application, I've deployed the same code to Appfog.com. And as expected, the application works just fine.




THE SOLUTION

After talking to Microsoft Support, we found …

[Safari] Cookies for iFrame domain not set

The Problem Apple's Safari web browser is configured to block third-party cookies by default, unless the user has had prior interactions with the third-party domain:
http://webpolicy.org/2012/02/17/safari-trackers/


The Solution The idea is simple, just make sure the user visits the iframe domain (in this example, B.com) at least once.

One way is to run a popup that visits B.com (and set the P3P header), then close the popup.

On the parent window:
var win = window.open('http://B.com/startsession.php', '_blank', 'height=200,width=150');
setTimeout(function() {
win.close(); // close it after 1 second :)
}, 1000);
Then in the startsession.php, just set the header will do
<?php
header('P3P: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"');
session_start();
Done.


References:
http://webpolicy.org/2012/02/17/safari-trackers/
http://anantgarg.com/2010/02/18/cross-domain-cookies-in-safari/
http://anantgarg.com/2012/02/18/busting-the-cookies-and-privacy-…

Android ChatHead Tutorial - (1) Setup ChatHead

Step 1: Setup an Android Project
Android ChatHead requires "SYSTEM_ALERT_WINDOW" permission which is available since API level 1, so minimum API 7 is fine.

Just next, next next... and create a blank activity :)



Step 2: Add ChatHead Service
If you want to know more details about ChatHead service. Read this article by Pierre-Yves Ricau.
Create a ChatHead Class that extends Service.
/java/com/gbinghan/androidchathead/ChatHeadService.java

Create ChatHead layout file.
/res/layout/service_chat_head.xml

Add ChatHeadService to AndroidManifest.xml

<service android:name="com.gbinghan.androidchathead.ChatHeadService" ></service>
Add SYSTEM_ALERT_WINDOW to AndroidManifest.xml
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
Your AndroidManifest.xml should look like this.


Step 3: Add a button to launch the service :)
Add OnClickListener in Activity file java/com/gbinghan/androidchathead/MainActivity.java.
findViewById(R.id.button…

Android Studio - android-4.2.2/dx failed when importing Facebook Android SDK

Problem

Got this error in Android Studio while following Getting Started with the Facebook SDK for Android (Android Studio) tutorial on Facebook.

Gradle: Execution failed for task ':HelloWorldAndroid:dexDebug'.
> Running /Applications/Android Studio.app/sdk/build-tools/android-4.2.2/dx failed. See output




Solution

1. Use latest Android Gradle Plugin

First, in order to use the most recent version of the Android Gradle Plugin, change all occurences of Gradle classpath in build.gradle file.

buildscript {
  dependencies {
    classpath 'com.android.tools.build:gradle:0.4'
  }
}


to

buildscript {
  dependencies {
    classpath 'com.android.tools.build:gradle:0.4.+'
  }
}


2. Install Android Repositories

Make sure the following components of Android SDK are installed:

Android Support RepositoryGoogle Repository


3. Change the reference for Android Support library

The correct way to reference to Android Support Library is shown below. (Instead of referencing android-suppor…

Google Maps CSS not displaying correctly (when using Twitter Bootstrap)

Was wondering why the Google Maps Control Set tools works displaying correctly on standalone page but not when the same snippet pasted in my project site.

Took me a while to figure out its because of Twitter Bootstrap CSS interfering with Google Maps images.

The simple workaround was posted in Twitter Bootstrap Github Issue.
<style type="text/css">
/** FIX for Bootstrap and Google Maps Info window styes problem **/
img[src*="gstatic.com/"], img[src*="googleapis.com/"] {
max-width: none;
}
</style>
Hope this helps! :)

Install MongoDB for PHP5.4 on MAMP

1. Download mongo.so from https://github.com/stennie/mongo-php-driver/downloads

2. Copy mongo.so to MAMP PHP folder.

For example, mine is at
/Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/ Remember to select the correct PHP version. You can check your PHP version from your MAMP start page, e.g http://localhost/MAMP/phpinfo.php


3. Enable the extension in PHP Configuration file (php.ini). You can find the path to the file from the PHPInfo (see above example).

To enable, add the following line in the "Dynamic Extension" section.
extension=mongo.so
4. Restart your MAMP. You should see "mongo" section in PHPinfo.




[Solution] Wordpress "An error occurred in the upload. Please try again later" error.

Got this weird "An error occurred in the upload. Please try again later" error whenever I try to do media uploads in Wordpress.



I've checked the folder permission, its correct. In fact, the files were uploaded successfully to wp-content > upload folder.

I've tried all kinds of suggestion in forums (disable all plugins, enable them one by one... etc), but still no avail.

In the end, I decided to do a "Re-install", and that... worked!



And all the uploaded files were intact.


-----

Didn't dig deep into finding out what causes the issue.

But a wild guess would be something to do with the PHP codes. Because the uploaded files were stored in DB, although the upload status indicated "failed".

Most likely something to do with the permission issue highlighted in this blog post.

List of Brainwave Headbands

PayDollar Test Credit Cards

Was looking for Test Credit cards to test integration with AsiaPay/PayDollar via Google but couldn't find any. But manage to find one in the PHP sample source code.
Card number: 4918914107195005
CCV: 123
Expiry Date: 07 2015
Card Holder: Test Card
Extras.

For first timer like me, I find PayDollar website & documentation slightly messy, and sometimes, the links on the site are broken.

Integration Guide
Home Page, v3.21
Sample Source Codes

Can be found in
Merchant Administration page > Support > Developer Corner The direct links are as follow:
Client Post: PHP
Direct Client Side: PHP
Direct Server Side: PHP