Unable to install Homebrew

Unable to install Homebrew with this? ruby -e “$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)” What’s happened -e:70: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777 ==> This script will install: /usr/local/bin/brew /usr/local/Library/… /usr/local/share/man/man1/brew.1 Press RETURN to continue or any other key to abort ==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew Password: ==> Downloading and installing Homebrew… remote: Counting objects:…

Read more...

Capitalizing Words in Javascript

This is a very old draft stuck at the bottom of my draft list. lol [sourcecode language=”javascript”] var str = "hello world"; str = str.toLowerCase().replace(/b[a-z]/g, function(letter) { return letter.toUpperCase(); }); alert(str); //Displays "Hello World" [/sourcecode] Making it as a function, we can do this. [sourcecode language=”javascript”] function capitalize(str) { return str.toLowerCase().replace(/b[a-z]/g, function(letter) { return letter.toUpperCase();…

Read more...

PHP使用Json中文/Unicode亂碼解决方法

[sourcecode language=”php”] $string = ‘你好嗎’; echo json_encode($string); //Output "u4f60u597du55ce" echo preg_replace("#u([0-9a-f]+)#ie", "iconv(‘UCS-2’, ‘UTF-8’, pack(‘H4’, ‘1’))", json_encode($string)); // Output "你好嗎" [/sourcecode]

Read more...

Handle unwanted character changes in Json for unicodes encoding in PHP

Json has been an efficient way to handle information and message exchanges in web programming. For example, I usually use PHP to connect MySQL and retrieve information, then display as Json. So a webpage can “AJAX” the displayed Json to create a dynamic view on itself. However, while the information involves unicode characters, PHP turn…

Read more...

Making use of Adobe Script

I have been using adobe products such as illustrator and photoshop for years to support my works. The lastest work would be making icons for my Chrome Extensions =]. Adobe script has no doubt saved me a lot of time. And what make me excitied is that the script can be Javascript. Adobe script is…

Read more...

Home-made “Recent Comments” for Blogger

I suddenly want to write a “Recent Comment” for this Blogspot as I am not satisfied with the default one. It is not difficult as I made use of jQuery to dual with the comment feed in Json format. All the data is avaliable and ready, what I do is just adjusting the location into…

Read more...