Categories
PowerShell

Delete Folders Older Than # Days

PowerShell Script to delete folders older than # days

$Now=Get-Date
$Days="90"
$TargetFolder="C:\temp\"
$LastWrite=$Now.AddDays(-$Days)

$Folders = get-childitem -path $TargetFolder | 
Where {$_.psIsContainer -eq $true} | 
Where {$_.LastWriteTime -le "$LastWrite"} 

 foreach ($Folder in $Folders) {
 write-host "Now Deleting $Folder" -foregroundcolor "Green"
 Remove-Item $TargetFolder$Folder -recurse -Confirm:$false
 }
Categories
CSS

KeyCap Style in CSS

To simulate a keyboard key on a web page, use the following style with a span tag;

1
<span class="keycap">KeyCap</span>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 /* ----- KeyCap Style ----- */
span.keycap {
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  -o-border-radius: 4px;
  -khtml-border-radius: 4px;
  white-space: nowrap;
  border: 1px solid #aaa;
  border-style: outset;
  border-radius: 4px;
  padding: 0px 3px 1px 3px;
  margin: 0px 0px 0px 0px;
  vertical-align: baseline;
  line-height: 1.8em;
  background: #fbfbfb;
}
Categories
eMail iPhone

Can't Log In to Gmail on an iPad or iPhone

Can't log into your Goggle or Gmail account on an iPhone or iPad?

It could be the your 2-Step-Verification that's causing a "Password Incorrect" error when logging into Gmail, etc.

To fix this, you'll need to visit the Google App Password generator to get a one-time password that will authorize the device.  After that you can use your normal password.

  1.  Log into Google with the relevant account.
  2. Go to https://security.google.com/settings/security/apppasswords.
  3. Select the App and the device you want to generate the app password for, then click GENERATE.
  4. Follow the instructions provided with the generated password that appears. Once you've entered the 16 character one-time password your email will be enabled on that device.

 

Categories
eMail

Adding Google Calendars on an iPhone or iPad

Trying to see multiple Google calendars on an iPhone or iPad can be maddening, until you find the trick.

On the device, log into your Google account. Then visit https://www.google.com/calendar/iphoneselect where you will be able to select and save your calendar selections.

It may be necessary to delete and remove your Gmail account to re-trigger the calendars.

Categories
CSS

Center an HTML element in the screen

The following sample shows how to center an HTML image in the screen, vertically as well as horizontally. The image will shift to maintain the centre as the window size is changed.

For more detail, see this link.

<!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>Your Website</title>
	<style>
	.Absolute-Center {
		margin: auto;
		position: absolute;
		top: 0; left: 0; bottom: 0; right: 0;
		}
	</style>
	</head>
<body>
	<img src="image.jpg" class="Absolute-Center" />
</body>
</html>