404 Page Not Found After Migrate WordPress Database

Recently I lost my local WordPress development environment, so I need to get the copy from my server, I still have WordPress source files, so I just need to FTP back my themes folder and export the whole database in SQL file.

After I get the SQL file, I open the SQL file in text editor and replace all the server domain to my local domain, e.g. changing www.stephensaw.me to stephensaw.local. Then run the SQL on my local database to restore it, it works great, can access to stephensaw.local without problem, can access to admin, the site URL in admin also correct.

But,

Read more ... →

March 11, 2015 · Stephen Saw

Set Initial View in Xcode 6

I was playing with Xcode 6 and messed up all the views in storyboard, so I’ve decided to delete all the view and drag in new view controller, and I wasn’t able to run the app because it can’t find the initial view. Previously I’ve learned that I can set which view to be initial view by dragging the starting point arrow, but since I dont’ have anything on my storyboard, that arrow was gone, even after I dragged in the new view controller

To get the starting point arrow back:

Read more ... →

December 12, 2014 · Stephen Saw

Google Chrome DevTools Source Maps

Google Chrome DevTools is getting better and better everyday, ridiculously fast performance with their Blink and V8, and they just got better with their DevTools. What I just found out recently was, editing source code right on the Chrome DevTools using source mapping.

Source Maps

To verify is source maps is turn on, go to the setting gear icon on DevTools, and then verify the Source Maps option are checked.

Read more ... →

October 1, 2013 · Stephen Saw

Simple Workflow Improvement with Sublime Text 2

Sublime Text 2 is a simple looking yet it is a very powerful editor, with the package system and keyboard shortcut, it mades writing codes fast and simpler. Here are some tips and tricks to improve our daily workflow a bit, I’m using Sublime Text 2 here because I found some plugin is not working properly on Sublime Text 3.

Install Package Control

First thing first when using Sublime Text is, install the package control. Head over to https://sublime.wbond.net/installation#st2, copy the long string and paste it into the Sublime Text console.

Read more ... →

September 21, 2013 · Stephen Saw

Creating Snippet in Visual Studio

There are times where we need to type out some skeleton codes, and if we smart enough, we copy it from existing one and change some variable, what if we can use shortcut to insert that skeleton codes, and using tab to change all the variable we needed to change?

To do this in Visual Studio (I’m using Visual Studio 2012)

Read more ... →

May 21, 2013 · Stephen Saw

Installing SharePoint 2013 on Windows Server 2012 - Part 3

After installed SQL Server 2012 from part 2, is time to install SharePoint Server 2013.

Download SharePoint Server 2013 Prerequisites PowerShell Scripts

Even though SharePoint installer will install all the prerequisites via online, but I sometimes prefer that I have a copy offline, because I don’t like to waste my bandwidth to redownload the installers when I want to reinstall my SharePoint for some reason.

There are some PowerShell scripts available in TechNet download, which help us to achieve that. So, get the scripts from there and extract the zip file.

Read more ... →

April 24, 2013 · Stephen Saw

Installing SharePoint 2013 on Windows Server 2012 - Part 2

After installed and configured Windows Server 2012 from part 1, is time to install SQL Server 2012.

Install SQL Server 2012

Insert the installer disc, mount the iso file or whatever, and wait for the auto run. On the SQL Server Installation Center screen, click Installation on the left side, and click New SQL Server stand-alone installation or add features to and existing installation

Read more ... →

April 21, 2013 · Stephen Saw

Installing SharePoint 2013 on Windows Server 2012 - Part 1

Been working on SharePoint (not extensively) for some times now, and it’s kind of interesting and frustrating when come to setting things up properly, and I finally have chance to trial out the latest and greatest of Windows Server and SharePoint.

Prerequisites**

  • Windows Server 2012
  • SQL Server 2012
  • SharePoint Server 2013 Preview

Install Windows Server 2012

This one would be the simplest of them all, boot the installer and install like Windows 7 or 8.

Read more ... →

April 16, 2013 · Stephen Saw

Creating jQuery Plugin for RTE Intellisense

Was doing some proof of concept with RTE plugin like CKEditor or TinyMCE, and ended up with an interest to incorporate a text hints or intellisense for the editor.

At first I was trying to use the jQuery Autocomplete, but it tie to a input box, and RTE does not use input box, they use contenteditable DOM element like <body> inside an iframe. And I came across the amazing code editor CodeMirror that came with the amazing autocomplete feature that I was looking for, it pops up nicely where it meant to be, and performance was terrific, but I don’t want dependencies from any of CodeMirror’s code base, and reverse engineering isn’t my strength.

Read more ... →

February 6, 2013 · Stephen Saw

Open Source Software Licenses

Had some read up on open source licenses due to work related, and had a realization that free software is not free as in beer, but freedom to change or distribute the software.

But not all of the open source licenses are friendly to a commercial product, the notable one is GPL, which required the project that uses it to be open source, it’s not so cool for commercial product that wanted to use GPL licensed library in small portion of the project, but required to open source all source code. But GPL license give the open source community an competitive edge to the commercial product by requiring project source code to be open. (read more here)

So, MIT license come to save the world, it basically allow linking of MIT licensed library in commercial product without open source the rest of the source code, neat. But I’ve came across another permissive license, but with cooler name, the WTFPL. As name implied, you can do what the fuck you want with it, and the license terms is short and easy to understand.

Read more ... →

January 27, 2013 · Stephen Saw