Wednesday, November 6, 2013

In time entry circumstances do not have the duration of an activity calculated off of inputs for the moment one got started and the moment one finished up.

This does not take lunch breaks into account. This system gets really silly when a task straddles several days as the worker is not working twenty-four hours without break, etc.

blue flash

A better way to solve the problem I was trying to solve here in Chrome is to only make divs that float with absolute positioning clickable if they do not sit inside of another div. Otherwise the div they sit within may turn blue.

a jQuery hack to get Chrome to stop holding a selection

...is to hide a form field out of sight (absolute positioning with a negative margin) and update it.

$("#deselecttrick").focus().val("deselecttrick");

update an HTML control by name in jQuery

$("[name='" + foo + "']").val(bar);

Tuesday, November 5, 2013

To change tabs to spaces in Sublime...

  1. select copy
  2. click on "Tab Size" at the lower right
  3. pick "Convert Indentation to Spaces" at the menu which pops up

when pushing an integer into a Web SQL Database column that expects a string...

...you may end up with a one point precision on your "integer"

When a function returns a promise.

var foo = iReturnPromise(bar, baz);
var qux = iDoSomethingElse(foo);

 
 

...will not work! (assuming iDoSomethingElse expects an object and not a promise) Instead, the way to skin this cat is...

 
 

var fooPromise = iReturnPromise(bar, baz);
fooPromise.then(function(foo) {
   var qux = iDoSomethingElse(foo);
});