Use Git to perform daily backup

You can use git to perform scheduled backup for your file, for example, backup a site deploy. For example, I want to backup a site named MVC4 I use git + script + scheduled task to do the backup, the advantage of this approach is that: Each backup can be compared for changes. Save disk… Read More »

Multi-Language for ASP.Net Website Project using Satellite Assembly

Satellite assembly introduction A satellite assembly is a compiled library (DLL) that contains (“localizable”) resources such as strings, bitmaps, etc. You are likely to use them when creating a multilingual (UI) application. Satellite assemblies provide you with the capability of designing and deploying your solution to multiple cultures, rather than hard coding strings, bitmaps, etc.,… Read More »

.Net Build System for Sublime Text 2

Sublime text 2 is a great text editor that every develop should get a copy at least give a try. I create a build script for .net in sublime text 2. It can do the following things: Build source code into .exe file under your sublime project folder recursively. Add reference DLLs while building source… Read More »

Modify Nextgen Gallery to Extract Picasa’s Caption

I use Picasa to manage my photos locally and Nextgen gallery(a wordpress plugin) as my online photo albums. And in Picasa, captions can be added to photo’s meta tags, like this: When upload to Nextgen gallery, I would like to have this caption to be added to the photo’s title and description. So I modified… Read More »

Mask Mobile Number Using C#

A small piece of code which mask any string with specific mask characters. // Mask the mobile. // Usage: MaskMobile("13456789876", 3, "****") => "134****9876" public static string MaskMobile(string mobile, int startIndex, string mask) { if (string.IsNullOrEmpty(mobile)) return string.Empty; string result = mobile; int starLengh = mask.Length; if (mobile.Length >= startIndex) { result = mobile.Insert(startIndex, mask);… Read More »

Category: c#

Getting Started with Selenium in CSharp

Selenium is a suite of tools to automate web app testing across many platforms. You may download and use Selenium from http://seleniumhq.org/ In this post, I would like to introduce the basic usage of Selenium in .Net development. Create Selenium instance In Selenium 2.0, there is a concept named WebDriver which is used to interacting… Read More »

JavaScript File Selection Simulation

Context The build-in file selection elements of browsers are ugly and cannot be customized easily. If developer need to change the appearance of the file selection element, it’s almost impossible because of some security issues. So I wrote this script to simulate the file input selection by javascript so that the end user can click… Read More »