Windows: Don’t update Google Chrome (i.e. disable auto update)

By default Google Chrome will update to the latest version automatically. It is however possible to disable this and instead update manually (when needed/wanted).

Note: This means you will not get security updates as threats are found and these get fixed – so this might be a bad idea to do if you don’t plan to update manually.

Open up a registry editor and check if the key “HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Update” exists, otherwise create it (the key is the tree structure in regedit).
Now enter a Key name “DisableAutoUpdateChecksCheckboxValue ” as a DWORD and give it the value “1”.
This will keep Google Chrome from auto updating.

Setting up JAVA_HOME on Window

The JAVA_HOME variable should point to the JDK’s bin folder in order for Java applications (jar, war, etc) to know where Java lives.

To setup a JAVA_HOME environment variable on Windows.

  • Right click on the My Computer icon in the start menu or on the desktop and select properties
  • Click the Advanced Tab
  • Click the Environment Variables button
  • Under System Variable, click New
  • Enter the variable name as JAVA_HOME
  • Enter the variable value as the install path for the Development Kit
  • Click OK
  • Click Apply Changes

Word of caution, Java is not fond of spaces, so I use pathnames without spaces.

Note: You will need to click OK, apply changes AND reload cmd to see the changes there.

FireFox 2.x don’t show the session restore window

When FireFox 2.x came out it was the first version that introduced session restore if the browser crashed (or was shut down hard/incorrectly).

This can be turned off by going into “about:config” finding the key “browser.sessionstore.resume_session” and setting this to false

Also you probably want to check out the startup options under “Tools->Options->When Firefox starts

(This can also be used to show the session restore window by setting the “browser.sessionstore.resume_session” to true)

Note: This can also be used with Flock versions 2.6.x as that is based on FireFox

PHP raw POST data

To read the raw data being posted to a php page (for instance when $_POST is empty due to problems with encoding types or $HTTP_RAW_POST_DATA not being readable due to php.ini settings) reading file_get_contents is a nice solution.

$postData = file_get_contents('php://input');

Adding htmlattributes to a ActionLink

To add htmlattributes to a ActionLink might be needed for instance for the layout of the page.

@Html.ActionLink("Link text", "action", "Controller", null, new {style="float:left"})
//Adding a css class (need the @sign as class is a keyword for the compiler). It is also possible to use a Capitol C in Class but then it fails some validations.
@Html.ActionLink("Link text", "action", "Controller", null, new {@class="myCssClassName"})
 
//the syntax for the Html.ActionLink (used in this example is)
public static MvcHtmlString ActionLink(
	string linkText,
	string actionName,
	string controllerName,
	RouteValueDictionary routeValues,
	IDictionary<string, Object> htmlAttributes
)

C# MVC# create a URI from a Url.Action

Sometimes the need arises to create a URI object instead of just a link. This can be done by using Url.Action.

new Uri(Url.Action("action", "controller", null, Request.Url.Scheme))
 
//definitions 
public Uri(
	string uriString
)
 
public string Action(
	string actionName,
	string controllerName,
	Object routeValues,
	string protocol
)

Specifying what area an ActionLink should use

Using routevalues you can tell the html helper what area you want to create a action link to.

//create a link that will go to AreaName
Html.ActionLink("Link Text", "ActionName", "ControllerName", new { Area = "AreaName" }, new{})
//Default area (= no area)
Html.ActionLink("Link Text", "ActionName", "ControllerName", new { Area = "" }, new{})
 
//create a link that will go to AreaName and with some htmlAttributes
Html.ActionLink("Link Text", "ActionName", "ControllerName", new { Area = "AreaName" }, new{@class="myCssClass"})
 
 
//Definition
public static MvcHtmlString ActionLink(
	string linkText,
	string actionName,
	string controllerName,
	RouteValueDictionary routeValues,
	IDictionary<string, Object> htmlAttributes
)