Learning To Blog With Github Pages

Reading time ~1 minute

First level header

Second level header

One Of My Favourite Quotes

“I suppose the thing I most would have liked to have known or been reassured about is that in the world, what counts more than talent, what counts more than energy or concentration or commitment, or anything else - is kindness. And the more in the world that you encounter kindness and cheerfulness - which is its kind of amiable uncle or aunt - the better the world always is. And all the big words: virtue, justice, truth - are dwarfed by the greatness of kindness.” ~ Stephen Fry

A Script I Wrote1

'copydesktopfavourites.vbs
'Copies user's Desktop and Favorites directories to a selected location
Dim objProgressMsg

'Create Progress Message function which displays a progress message box.
'Progress Message function written by Dennis St-Pierre http://www.robvanderwoude.com/vbstech_ui_progress.php
'If strMessage is blank, close progress message
Function ProgressMsg( strMessage, strWindowTitle )
    Set wshShell = WScript.CreateObject( "WScript.Shell" ) 
    strTemp = wshShell.ExpandEnvironmentStrings( "%TEMP%" ) 
    If strMessage = "" Then
       'Disable error checking in case objProgressMsg doesn't exist yet
       On Error Resume Next
       objProgressMsg.Terminate( )
       'Re-enable error checking
       On Error Goto 0
       Exit Function
    End If 
    Set objFilesystem = CreateObject("Scripting.FileSystemObject") 
    strTempVBS = strTemp + "\" & "Message.vbs" 
    'Create Message.vbs in temp directory, True=overwrite
    Set objTempMessage = objFilesystem.CreateTextFile( strTempVBS, True ) 
    objTempMessage.WriteLine( "MsgBox""" & strMessage & """, 4096, """ & strWindowTitle & """" ) 
    objTempMessage.Close
    'Disable error checking in case objProgressMsg doesn't exist yet
    On Error Resume Next
    'Kill previous ProgressMsg
    objProgressMsg.Terminate( ) 
    'Re-enable error checking
    On Error Goto 0 
    'Trigger objProgressMsg and kaap an object on it
    Set objProgressMsg = WshShell.Exec( "%windir%\system32\wscript.exe " & strTempVBS ) 
End Function 

'Open Browse dialog for user to select destination directory
'Disable error checking in case no directory is selected
On Error Resume Next
Const BIF_EDITBOX = &H10
Const BIF_NEWDIALOGSTYLE = &H40
Set objBrowse = CreateObject( "Shell.Application" )
Set objFolder = objBrowse.BrowseForFolder( 0, "Select folder to save documents to:", BIF_EDITBOX Or BIF_NEWDIALOGSTYLE )
strDestination = objFolder.Items.Item.Path & "\"
'If nothing is selected; show error message
If Err.Number > 0 Then
    MsgBox( "You have not selected a folder." & vbCrlf & "The backup will not continue!" )
    Err.Clear
Else
    'Create the string for the Source location C:\Users\<username>\Desktop & Favorites
    Set objShell = CreateObject( "WScript.Shell" )
    strProfile = objShell.ExpandEnvironmentStrings( "%userprofile%" )
    strDesktop = strProfile & "\Desktop"
    strFavorites = strProfile & "\Favorites"
    'Copy Desktop and Favorites folder to selected directory
    'Check that profile folder exists, then copy folders
    If objFilesystem.FolderExists(strProfile) Then
       'Call Progress Message function from above and copy files
       ProgressMsg "Copying files, Please wait.", "Copying Files"
       objFilesystem.CopyFolder strDesktop, strDestination, 16
       objFilesystem.CopyFolder strFavorites, strDestination, 16
       ProgressMsg "Backup complete", ""
    Else
       MsgBox( "User folder does not exist." )
    End If
End If

For a list of syntax you can use with these codeblocks go here: http://pygments.org/docs/lexers/

These are some of the syntax available:

  • ActionScript
    • ActionScript3
  • LLVM
  • CSS
  • Python 3

Don’t forget about the quote


  1. I wrote this script to make it easy for users to move their profile folders to a USB drive before we wiped their laptops. You can also find it here: http://community.spiceworks.com/scripts/show/2252-copy-folder-to-selected-directory

Review of Frank Ocean's Blond

In depth review of Frank Ocean's aklbum Blond Continue reading

Moved to CloudFlare for HTTPS

Published on June 22, 2016

My Son's Birth

Published on April 13, 2013