Posts

Showing posts from 2013

Enable/Disable Proxy using VBScript

reference: http://stackoverflow.com/questions/19537553/timer-usage-on-vbs Option   Explicit Const  HKCU  = &H80000001 Const  KEY  =  "Software\Microsoft\Windows\CurrentVersion\Internet Settings" Const  VALUE  =  "ProxyEnable" Const  TITLE  =  "Disable IE Proxy" Const  PROXY  =  "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer" Dim  wmi Dim  iProx Set  wmi  =  GetObject ( "winmgmts:\\.\root\default:StdRegProv" ) Call  wmi.GetDWordValue (HKCU ,KEY ,VALUE ,iProx ) Select   Case  iProx    Case   1 :      If   MsgBox ( "Proxy is ENABLED. Do you want to disable it?" ,  vbQuestion + vbYesNo , TITLE ) =  vbYes   Then        'disable, delay, then re-enable        Call  wmi.SetDwordValue (HKCU ,KEY ,VALUE , 0 )        Call  wmi.GetDWordValue (HKCU ,KEY ,VALUE ,iProx )        MsgBox ( "Proxy Disabled (" & iProx  &  ")"  &  vbCrLf  &  "Current Proxy: " ...

Custom Errorpage in MVC 4

Custom error in MVC 4 Source: http://thirteendaysaweek.com/2012/09/25/custom-error-page-with-asp-net-mvc-4/ Add the following Application_Error method to my Global.asax: protected void Application_Error ( object sender, EventArgs e ) { Exception exception = Server . GetLastError ( ) ; Server . ClearError ( ) ;   RouteData routeData = new RouteData ( ) ; routeData . Values . Add ( "controller" , "Error" ) ; routeData . Values . Add ( "action" , "Index" ) ; routeData . Values . Add ( "exception" , exception ) ;   if ( exception . GetType ( ) == typeof ( HttpException ) ) { routeData . Values . Add ( "statusCode" , ( ( HttpException ) exception ) . GetHttpCode ( ) ) ; } else { routeData . Values . Add ( "statusCode" , 500 ) ; }   IController controller = new ErrorController ( ) ; controller . Execute ( new Reques...

Add clickable events on particular dates in jQuery UI Datepicker.

Copied from:  http://stackoverflow.com/questions/5578259/jquery-ui-datepicker-how-to-add-clickable-events-on-particular-dates There are a couple of steps you'll have to take: Initialize the datepicker in-line. Attach the datepicker widget to a  <div>  so that it will always appear and you won't have to attach it to an  input : $ ( "div" ). datepicker ({...}); Tap into the  beforeShowDay  event to highlight dates with specific events. Also, define your events in an array that you can populate and send down to the client: Events array: var events = [ { Title : "Five K for charity" , Date : new Date ( "02/13/2011" ) }, { Title : "Dinner" , Date : new Date ( "02/25/2011" ) }, { Title : "Meeting with manager" , Date : new Date ( "03/01/2011" ) } ]; Event handler: beforeShowDay : function ( date ) { var result = [ true , '' , null ]; ...