Interesting documentary on how crazy it is for millions of Chinese people to take the train home back to their villages for the Chinese New Year and a look at their living conditions and lifestyle.
Documentary: Park Avenue: Money, Power & The American Dream
Must see documentary by all US taxpayers.
[youtube http://www.youtube.com/watch?v=6niWzomA_So]
Watch the full documentary at http://www.hulu.com/watch/417228
Setting Up PHP to Support UTF-8 / i18n International Characters
Instead of specifically writing string manipulation code that is multibyte-safe, e.g. mb_substr() instead of substr(), you can configure PHP to do this automatically. Just update the following lines in your php.ini.
mbstring.internal_encoding = UTF-8
mbstring.func_overload = 7
mbstring.strict_detection = On
zend.multibyte = On
zend.script_encoding = UTF-8
mbstring.func_overload will automatically cause any non-multibyte-safe functions to use their multibyte-safe counterparts.
URLs with UTF-8 / Non-ASCII Characters
When determining the URL for a web page, you often want to use keywords that accurately describe the page’s content. Sometimes, these keywords aren’t in English and contain accented characters. One thing you can do is choose one URL to be the canonical URL and create a redirect to that URL from another that contains the ascii-equivalent version of the words, e.g.
Canonical: http://www.somedomain.com/nǐhǎo
Redirects:
- http://www.somedomain.com/nihao
- http://www.somedomain.com/你好
Adding Self-Signed SSL For Local Web Development with https Auto-Redirect
1. Generated a server certificate and server private key
http://www.selfsignedcertificate.com/
2. Download the files, e.g.
9264078_local.dev.mydomain.com.cert
9264078_local.dev.mydomain.com.key
and put them in your Apache conf folder, e.g. C:Apache24conf
Continue reading Adding Self-Signed SSL For Local Web Development with https Auto-Redirect
Fixing Apache Errors on Windows
If you’ve installed Apache on Windows and are used to (re)starting the Apache service from a GUI interface, you’ll have a hard time debugging errors in your httpd configuration files, if there are any, since the GUI response will simply say
“The requested operation has failed!”
i8n / Internationalization Test Word
Here’s a good word to use to test if your files are UTF-8 -encoded and support international characters.
Iñtërnâtiônàlizætiøn
For more information about UTF-8 character encoding, visit
Mac: Creating Shortcut Host Names When Connecting Over SSH in Terminal
If you’re on a Mac and want to connect to another computer over SSH via your Terminal, you can create a shortcut so that instead of typing
> ssh server1.ops.somedomain.com
you can just enter
> ssh server1
Continue reading Mac: Creating Shortcut Host Names When Connecting Over SSH in Terminal
Sublime Text 2 Shortcuts
- CTRL+r
- CTRL+ALT+t : HTMLTidy
- CTRL+ALT+E : Encode special characters
- CTRL+. : close tag
- CTRL+SHIFT+[ : Fold Code
- CTRL+t : Fold Tag Attributes
- <tag + TAB = autocompletion, e.g. <a + TAB = <a href=””></a>
- <tag> + ALT + . = autocompletion, eg. <a> + ALT + . = <a></a>
- CTRL+F : Find in file
- CTRL+SHIFT+F : Find in files (or right click on folder and click Find in Folder)
- CTRL+H : Find and replace in file
HOSTS File: Change an External Domain to Point Somewhere Else
If you update your hosts file to point a domain to another location, accessing that domain will take you to your new destination. For example, in Windows, your hosts file is at
C:WindowsSystem32driversetchosts
If you add the following:
127.0.0.1 www.google.com
and then open your browser and go to www.google.com, you will not see Google’s home page but rather your local host index page. This can be handy when you want to disable one javascript include in a page that you don’t have access to. By pointing the external javascript domain to your local host, a 404 not found will be triggered which will prevent the code from running. Everything else, including other references to external javascript files, in the page will still continue to execute.