This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Requires the Moment.js library (Resources > Libraries > 15hgNOjKHUG4UtyZl9clqBbl23sDvWMS8pfDJOyIapZk5RBqwL3i-rlCo). Use the latest version. | |
*/ | |
function myFunction() { | |
var moment = Moment.load(); | |
var theHTML = ''; | |
var yesterday = moment().startOf('day').subtract(1,'days').format(); | |
var today = moment().startOf('day').format(); | |
var drive = DriveApp.searchFiles('modifiedDate >= "' + yesterday + '" and modifiedDate < "' + today + '"'); | |
theHTML = '<html><p>The following files were updated on Google Drive yesterday, ' + moment(yesterday).format('MMMM D, YYYY') + ':</p><ul>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub stampPDFs() | |
On Error Resume Next | |
Dim App As CAcroApp | |
Dim PDDoc As CAcroPDDoc | |
Dim fso As Scripting.FileSystemObject | |
Dim jso As Object | |
Dim i As Long | |
Dim FileName As String | |
Dim field As Object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$olFolderCalendar = 9 | |
$ol = New-Object -ComObject Outlook.Application | |
$ns = $ol.GetNamespace('MAPI') | |
$Start = (Get-Date).AddDays(-1).ToShortDateString() + " 00:00" | |
$End = (Get-Date).AddDays(+1).ToShortDateString() + " 00:00" | |
$Filter = "[MessageClass]='IPM.Appointment' AND [Start] >= '$Start' AND [End] <= '$End'" | |
$Appointments = $ns.GetDefaultFolder($olFolderCalendar).Items | |
$Appointments.IncludeRecurrences = $true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
Source = Json.Document(File.Contents("C:\Temp\missellacronin.json")), | |
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error), | |
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"created_at", "notifications", "user"}, {"created_at", "notifications", "user"}), | |
#"Expanded user" = Table.ExpandRecordColumn(#"Expanded Column1", "user", {"_id", "name", "created_at", "updated_at", "display_name", "logo", "bio", "type"}, {"user._id", "user.name", "user.created_at", "user.updated_at", "user.display_name", "user.logo", "user.bio", "user.type"}), | |
#"Changed Type" = Table.TransformColumnTypes(#"Expanded user",{{"created_at", type datetimezone}, {"user.created_at", type datetimezone}, {"user.updated_at", type datetimezone}}), | |
#"Calculated Local Time" = Table.TransformColumns(#"Changed Type",{{"created_at", DateTimeZone.ToLocal, type datetimezone}, {"user.created_at", DateTimeZone.ToLocal, type datetimezone}, {"user.u |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub dedupe() | |
Dim ol As New Outlook.Application | |
Dim dates As Collection | |
Dim mbox As Outlook.Folder | |
Set dates = New Collection | |
Set mbox = ol.ActiveExplorer.CurrentFolder | |
For Each msg In mbox.Items | |
msgDate = msg.SentOn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Declare PtrSafe Function SystemTimeToFileTime Lib _ | |
"kernel32" (lpSystemTime As SYSTEMTIME, _ | |
lpFileTime As FILETIME) As Long | |
Public Declare PtrSafe Function LocalFileTimeToFileTime Lib _ | |
"kernel32" (lpLocalFileTime As FILETIME, _ | |
lpFileTime As FILETIME) As Long | |
Public Declare PtrSafe Function FileTimeToSystemTime Lib _ | |
"kernel32" (lpFileTime As FILETIME, lpSystemTime _ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub CorrectDateOnPage() | |
Dim appOneNote As New OneNote.Application | |
Dim pageXML As New MSXML2.DOMDocument60 | |
Dim pageContent As String | |
Dim clipboard As New MSForms.DataObject | |
Dim tNodes As IXMLDOMNodeList | |
Dim tNode As IXMLDOMNode | |
thisPage = appOneNote.Windows.CurrentWindow.CurrentPageId | |
appOneNote.GetPageContent thisPage, pageContent, piAll, xs2013 | |
pageXML.LoadXML pageContent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function RxNorm(ByVal strNDC As String) | |
Dim xmlhttprequest As MSXML2.XMLHTTP | |
Dim xmlresponse As New MSXML2.DOMDocument60 | |
Set xmlhttprequest = New MSXML2.XMLHTTP | |
xmlhttprequest.Open "GET", ("https://rxnav.nlm.nih.gov/REST/rxcui?idtype=NDC&id=" & strNDC), False | |
xmlhttprequest.send | |
xmlresponse.Load xmlhttprequest.responseXML | |
If xmlresponse.SelectSingleNode("//rxnormId") Is Nothing Then | |
RxNorm = "**NDC Not Found**" | |
Exit Function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$results = @() | |
$headers = @{"Authorization" = "Bearer XXXXXXXXXX"} | |
$feed = Invoke-RestMethod -Uri "https://api.automatic.com/trip/" -Headers $headers | |
$next = $feed._metadata.next | |
while ($next -ne $null){ | |
foreach ($result in $feed.results){ | |
$results += $result | |
} | |
$feed = Invoke-RestMethod -Uri $next -Headers $headers | |
$next = $feed._metadata.next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create procedure [dbo].[InsertFollowers] | |
AS | |
BEGIN | |
truncate table dbo.followers | |
INSERT INTO dbo.followers | |
SELECT k.* | |
FROM OPENROWSET (BULK 'C:\temp\missellacronin.json', SINGLE_NCLOB) as j | |
CROSS APPLY OPENJSON(BulkColumn, '$') | |
WITH ( | |
created_at datetimeoffset, |
NewerOlder