2016-11-01

MacOS - PRAM Reset

  1. Turn the mac off.
  2. Unplug it for ~20 seconds.
  3. Plug it back (wall power supply).
  4. Press 4 keys simultaneously, for 10 seconds, then release
    1. left ALT OPTION
    2. left COMMAND
    3. the letter P
    4. the letter R



This works at least on a mac book pro.

MacOS - How to reset the SMC (System Management Controller)


  1. Turn the mac off.
  2. Unplug it for ~20 seconds.
  3. Plug it back (wall power supply).
  4. Press 4 keys simultaneously, for 10 seconds, then release
    1. left SHIFT
    2. left CONTROL
    3. left ALT OPTION
    4. POWER (top right)



This works at least on a mac book pro.

VirtualBox - How to extend/enlarge/grow your windows vm vdi hard drive


(1) Run this command line to grow to 100 GB

VBoxManage modifyhd HARD_DRIVE_FILE_NAME.vdi --resize 100000

(2) Open windows "Disk Management" app and right click over the hard drive you are trying to grow, and select "Extend". Follow the menu prompts (default selections work), and voila!


2016-10-20

Meteor - Returning a value from a call to a server method

Meteor.call(
"method-name"
, arguments
, function( error, result ){
  //actions go here
}
);

2016-10-19

MongoDB - Count distinct values of a given field, given a query

This will retrieve the distinct values in a json string (docs object)"

db.COLLECTION_NAME.distinct( "field_to_count", {query});



This would simply retrieve the count of distinct items (not the entire object with the list of all distinct values):

db.COLLECTION_NAME.distinct( "field_to_count", {query}).length;



MongoDB - Count distinct values of a given field, given a query

This will retrieve the distinct values in a json string (docs object)"

db.COLLECTION_NAME.distinct( "field_to_count", {query});



This would simply retrieve the count of distinct items (not the entire object with the list of all distinct values):

db.COLLECTION_NAME.distinct( "field_to_count", {query}).length;