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:…

Save Terminal from Process Completed in Mac OSX

What’s happening One day, when I opened up terminal as usual, it showed [Process completed] and just terminated. I could not type any thing, run any scripts and work on my project. Even worse, this made me unable to install programs into my computer because many installations need to run shell scripts. Okay, I searched…

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();…

Caffeine on Mac and Ubuntu

Caffeine has been a very useful app to instantly disable or enable the screensaver on mac. At least for me, I am using multiple computers in office and all of them except the one I am using will usually get idle. Getting into screensaver, however, is bad sometimes especially I was reading from that screen…

Show completions and quick help tips in Xcode

I know it is troublesome, tedious, or just like hell. Apple has his own way to do a common task. Very often, we need to use the autocompletion in IDE to assist coding so we do not need to memorize the billions of function names. In Eclipse, everything is automatic. A list of function names linked together…

Change author info for old commits in Git

While using hit, it is really usual to have regrets on the commits done, especially the name used. In order to change those information in your repository, open terminal (or cmd in windows), go to the folder of your git repositoy, and run the following commands. Remember, replace “old_name”, “new_name” and “new@email.address” with your own…

Merge 2 unrelated branches in Bazaar

To merge 2 entirely unrelated branches or projects, we need to specify 0 as first revision in revision range. Turn on terminal (in Mac) or cmd (in Windows) and get to your project folder. Merge with the following shell script. merge -r0..-1 means to merge from revision 0 to the latest revision. [sourcecode language=”shell”] bzr…

Posting source codes on WordPress

This is visual basic. [sourcecode language=”vb”] Private Function TempPath() As String Const MaxPathLen = 256 ‘Max length of the path, just as big as possible Dim FolderName As String ‘Name of the folder Dim ReturnVar As Long ‘Return Value End Function [/sourcecode] To do so, you need to wrap the code between [‌‌‌‌‌sourcecode language=”vb”] and…

Run shell commands in VBA

We can use shell to execute any programs. [sourcecode language=”vb”] shell("iexplorer") shell("cmd") [/sourcecode] Please be reminded that we may need to execute in an indirect way. [sourcecode language=”vb”] ‘cmd: execute CMD.exe (Windows Command Processor) ‘/c: with commands ‘dir: show all things in the default directory shell ("cmd /c dir") [/sourcecode] To make VBA wait until…