Tag Archive: programming

Publish WordPress Updates to Social Networks with IFTTT

Integrate IFTTT with WordPress

This post originally published on 02/23/2012. I don’t have the original version of the article anymore. The following content is recovered from web.archive.org. Since Wayback Machine only store HTML and links and doesn’t store any media files, the original images and videos has been removed and the corresponding content has been modified. Please read the original version over at Wayback Machine with image and video placeholders.

IFTTT is a web service that “put the Internet to work for you”. It stands for If This Then That.

If you have some programming knowledge, you know what it means. For instance, if you posted a tweet then post this tweet to Facebook, if you uploaded a video to YouTube then write a post on Tumblr, if today is raining then email you a warning, and so on. Basically, it means that if something happens then do the specified action. In “If this then that”, the “this” is a trigger and the “that” is an action.

This service is currently in beta, therefore it lacks many features. For example, it cannot allow users to create one trigger with multiple actions and vise versa. Because of this limitation, I created several same triggers with each different action:

IFTTT currently supports (exclude social network aggregators such as Boxcar and Buffer, as well as paid services such as Pinboard): Delicious, Diigo,Facebook, Flickr, Linkedin, Posterous, Storify, Tumblr, Twitter, and Zootool.

You can also create your own tasks by signing up for the service. As I stated in the beginning of this post, it’s like if … then statements in the programming world (maybe in real life as well), you can create some tasks just like scripting. For instance, you can write a tweet every 30 minutes using this service without knowing the Twitter API or writing any code.

Two Quick Sublime Text Tips

Sublime Text tips

After a long time, I decided to switch back from Coda to using Sublime Text as my main IDE because it has more customize options. Here are two of the quick tips I found during the setup of Sublime Text:

User Settings

By reading through the default settings in Preferences -> Settings – Default, you can see many useful settings which can be modified. Copy the lines on which the settings you wish to be modified, paste into Preferences -> Settings – User, and modify them from there.

Here are my user settings for Sublime Text:

Note that normally when you modified a file in Sublime Text, there will be a filled circle replacing the close button on the tab of modified file. With “highlight_modified_tabs” on, not only does it have the filled circle, the tab also changes color.

highlight_modified_tabs in Sublime Text

Once the user settings are saved, the change is immediate. No restart of Sublime Text is needed.

Move User packages folder

One of the benefits of using Sublime Text is that just like Linux, everything is a file, including its settings. On top of that, most changes modified by you is stored in the User folder inside the Packages folder in Sublime Text root folder (/Users/username/Library/Application Support/Sublime Text 2/Packages/User), such as installing a package and adding a snippet. By using this advantage, you can move the User folder to another location (such as an external hard drive or Dropbox folder) and link to it.

Type the following command into the terminal:

Replace “~/Development/Sublime/Packages/User” to the location you saved the folder to, as well as “username” with your username. Note that you must move the User folder to your desired location first.

As of this writing, I haven’t found a way to link the file using a File Manager.

Make alias in Finder

The Make Alias command in Finder for Mac does not work for this operation.

Please leave a comment below if you have a GUI way of link the User folder successfully.

Do you have any other tips on Sublime Text? Please share them in the comment below.

Some Useful gEdit Plugins for Developers: Part Two – Third-Party Plugins (1)


In part 1, I listed some useful development plugins in the default gEdit installation and the gedit-plugins. In this post, I will list the first batch of useful third-party plugins for developers from the third party gEdit plugins list (http://live.gnome.org/Gedit/Plugins).

The List

  • Advanced Find/Replace (http://code.google.com/p/advanced-find/)
    This plugin can search or replace specified characters whether in the current document, opened documents, or selected directory. The search results will be outputted to the Bottom Pane after a search is performed. It also highlights the search results in the document. It is useful to find a specified function or class within a project/directory.
  • AutoComplete (https://github.com/nagaozen/gedit-plugin-autocomplete/)
    This plugin suggests words that exists in the opened documents as you type. According to its website, I think it also suggests custom libraries although I was not tested it yet. It would save me lots of time to retype the function name.
  • Session Autosave (http://sourceforge.net/projects/geditautosaves/)
    Once this plugin is enabled, it will save the current opened tabs/documents on exit and reopen them when gEdit started next time. The feature is the exactly the same with NetBeans default feature for opening up last opened documents to continue editing them. However, I noticed that it only saves opened documents. This means that it will open the previously closed documents when gEdit started. The solution is to select Tools -> Session Save to refresh the session.

To Be Continued …

These are just a couple of plugins I tested. In the next post, I will list some more plugins useful for programming development. All the plugins mentioned in this post and the upcoming posts are available on the gEdit plugin page (http://live.gnome.org/Gedit/Plugins).

Do you have any gEdit plugins that does not list on the gEdit plugin page? Please share them in the comments below.

Linux Shell Programming Basics


I have been reading Wrox Beginning Linux Programming. The book mainly teaches how to programming in Linux using C. Since I’m learning the basics of C, I thought I could understand some of the materials in this book. In Chapter 2, it talks about shell programming and how does it relate to C programming in Linux. I wrote the following code which is based on the example code in Chapter 2:

And the screenshot below is the output:

Click the image to enlarge

Note that the read command is similar to the scanf function in C. They are used to let user input value. Also note that this script would take a moment to complete depending on the size of each file where the script file is in.

If you have this book, the above script is similar to the example provided in the Chapter 2 of the book, except I removed static input value (POSIX) and added an user input field using read command and several blank lines to make the output more cleaner.