Skip to content

Instantly share code, notes, and snippets.

View tim-bellette's full-sized avatar

Tim tim-bellette

  • Brisbane, Australia
View GitHub Profile
@tim-bellette
tim-bellette / IsHead.ps1
Created May 23, 2022 21:40
PowerShell script to check if the current repo is at the HEAD of the origin
[regex]::Matches((git ls-remote origin refs/heads/main), "^([\w\d]*)").Value -eq (git rev-parse HEAD)
@tim-bellette
tim-bellette / CalendarList.js
Created December 7, 2017 00:02
Get an array of SharePoint 2010 calendar instances on the current page.
var calendars = [];
var d = SP.UI.ApplicationPages.CalendarInstanceRepository.$o_0;
for (var k in d) {
calendars.push(d[k]);
}
@tim-bellette
tim-bellette / RefreshCalendar.html
Last active December 7, 2017 00:01
Simple script to automatically refresh a SharePoint 2010 calendar's items every 10 seconds
<script type="text/javascript">
setInterval(function() {
try {
var calendar = SP.UI.ApplicationPages.CalendarInstanceRepository.firstInstance(); // Get the first calendar instance on the page
if (calendar) {
calendar.refreshItems(); // async refresh of calendar items
}
}
catch (e) {
// ignore
@tim-bellette
tim-bellette / Program.cs
Last active December 6, 2017 22:58
Simple console application to output a hierarchy of Outlook folders, with their Entry ID, using NetOffice.
using System;
namespace OutlookFolderIdGrabber
{
public class Program
{
public static void Main(string[] args)
{
using (var application = new NetOffice.OutlookApi.Application())
{