Here is a Windows batch file that finds and deletes old files under a specific directory. In a second step the script removes folders that became empty after deleting the (old) files. Note that the scripts works recursively, i.e. it searches for old files and empty folders in any subdirectory under the specified path. One [...]
Read more…Archive for the ‘Howto’ Category
jQuery: Disable (browser) cache for all AJAX requests
Here is a small JavaScript code snippet that uses jQuery’s .ajax() function to disable the (client side browser) cache for all subsequent jQuery AJAX calls (note that caching is enabled by default for all data types except script and jsonp): $.ajaxSetup({ cache: false }); To enable caching for a special AJAX request one can override [...]
Read more…fit-PC2 & Ubuntu 9.10: Configure Wi-Fi access for WPA2 protected WLAN
Here is a step-by-step tutorial how to configure a fit-PC2 running Ubuntu 9.10 to connect to a WPA2 protected WLAN. First, follow the instructions on http://www.fit-pc2.com/forum/viewtopic.php?f=43&t=1150 to install some fit-PC2 packages that ensure the hardware support. After rebooting, the system should use the fit-PC2 kernel: # sudo uname -r 2.6.31-34-fitpc2 Next, create the file /etc/wpa_supplicant/wpa_supplicant.conf [...]
Read more…ASP.NET MVC 3 & Unity 2.0: Using XML configuration for design-time configuration
Introduction In one of my blog post “ASP.NET MVC 3: Dependency injection with Unity 2.0” I explained how to use the Unity 2.0 dependency injection (DI) container in an ASP.NET MVC 3 web application. The example shown in this previous post uses run-time configuration to set up the DI container. A drawback of run-time configuration [...]
Read more…ASP.NET Membership Provider: Changing user password without knowing the old one
If you want to change a membership user’s password with the MembershipUser.ChangePassword method you need to know the user’s old password. The following extension method defines a SetNewPassword method that enables you to reset the password without knowing the old one: public static class MembershipUserExtension { /// <summary> /// Set a new password for [...]
Read more…ASP.NET MVC3: Controller extension methods to render a partial view to string
To handle AJAX form requests in my ASP.NET MVC3 controller I needed a way to render a partial view to a string to return a JSON result containing both the (server-side) validation result (as boolean) and a rendered partial view (as string). Unfortunately in ASP.NET MVC3 there seems no out-of-the-box support for rendering partial views [...]
Read more…