Skip to content

Instantly share code, notes, and snippets.

@alirobe
alirobe / Load-CSOMProperties.psm1
Created July 22, 2016 05:24 — forked from glapointe/Load-CSOMProperties.ps1
Utility PowerShell function that facilitates the loading of specific properties of a Microsoft.SharePoint.Client.ClientObject object or Microsoft.SharePoint.Client.ClientObjectCollection object.
<#
.Synopsis
Facilitates the loading of specific properties of a Microsoft.SharePoint.Client.ClientObject object or Microsoft.SharePoint.Client.ClientObjectCollection object.
.DESCRIPTION
Replicates what you would do with a lambda expression in C#.
For example, "ctx.Load(list, l => list.Title, l => list.Id)" becomes
"Load-CSOMProperties -object $list -propertyNames @('Title', 'Id')".
.EXAMPLE
Load-CSOMProperties -parentObject $web -collectionObject $web.Fields -propertyNames @("InternalName", "Id") -parentPropertyName "Fields" -executeQuery
$web.Fields | select InternalName, Id
Verifying that +alirobe is my blockchain ID. https://onename.com/alirobe
@alirobe
alirobe / bom-cron.sh
Last active May 17, 2016 05:25
simple cron job that downloads weather forecasts from australian bureau of meteorology
# This script downloads weather forecasts from BOM
# Please ensure you comply with their usage terms and copyright...
# & to keep up with changes to this API
# - follow BOM here: https://data.gov.au/organization/bureauofmeteorology
# - star and fork this gist.
# New South Wales and ACT
curl ftp://ftp2.bom.gov.au/anon/gen/fwo/IDN11060.xml > NSW-ACT.xml
# Victoria
curl ftp://ftp2.bom.gov.au/anon/gen/fwo/IDV10753.xml > VIC.xml
/********************
GLOBAL
*********************/
body,
textarea,
input,
keygen,
select,
button {
font-family: 'segoe ui semilight', 'segoe ui', myriad, sans-serif;
@alirobe
alirobe / reclaimWindows10.ps1
Last active April 14, 2024 11:40
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@alirobe
alirobe / enable-impersonation.ps1
Last active March 8, 2016 07:47
Enable CRM 2013 SP1 - Exchange 2013 Synchronisation
# run on exchange machine
add-pssnapin Microsoft.Exchange.Management.PowerShell.SnapIn
$serviceAccountName = "CrmEmailServiceAcct"
$serviceAccountUser = Get-User -Identity $serviceAccountName
Get-ExchangeServer | where {$_.IsClientAccessServer -eq $TRUE} | ForEach-Object {
Add-ADPermission -Identity $_.distinguishedname -User $serviceAccountUser.identity -AccessRights ExtendedRight -ExtendedRight ms-Exch-EPI-Impersonation
Add-ADPermission -Identity $_.distinguishedname -User $serviceAccountUser.identity -AccessRights ExtendedRight -ExtendedRight ms-Exch-EPI-May-Impersonate
}
Get-MailboxDatabase | ForEach-Object {Add-ADPermission -Identity $_.DistinguishedName -User $serviceAccountName -ExtendedRights ms-Exch-EPI-May-Impersonate}
@alirobe
alirobe / umbraco-filebrowser.cshtml
Last active August 19, 2022 21:49
A simple recursive media folder/file viewer macro for directory browsing in #Umbraco 7+, using Bootstrap 3 for display. Not suitable for >100 files (use a surfacecontroller)
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@{ var mediaId = Model.MacroParameters["mediaId"]; }
@helper DisplayFolder(dynamic folder, bool collapsed) {
var items = folder.Children().OrderBy("DocumentTypeAlias Desc,Name");
if (items.Any()) {
<a class="list-group-item" role="button" aria-expanded="false" data-toggle="collapse" href="#macro-mediaList-folder-@folder.Id">
<i class="glyphicon glyphicon-folder-open"></i> &nbsp; @folder.Name
</a>
<div class="list-group @(collapsed?"collapse":"collapse in") well well-sm" id="macro-mediaList-folder-@folder.Id">
@foreach(var item in items) {
@alirobe
alirobe / gist:d5ad4cd9f3c0eed1dc27
Created July 2, 2015 05:11
SharePoint 2013 Related Pages
// shows related pages in SharePoint 2013 or Office 365
// via https://gist.github.com/chrisobriensp/4375519
// requires (minified under 10k): underscorejs, es6-promise (ES6 polyfill), fetch (ES6 polyfill)
function(element, title, count) {
var header = '<b>'+title+'</b><br/>';
var _linkTmpl = _.template('<a href="<%=Cells.results[6].Value%>"><%=Cells.results[3].Value%></a>');
var linkJoin = '<br/>';
var linkCount = count;
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">
@alirobe
alirobe / stickyfooter-2010.js
Last active December 15, 2015 06:39
A modification of Randy Drisgill's "Sticky footers in SharePoint" for SP2010. Works for me...
// Place the #custom-footer directly after the close of #s4-bodyContainer, and apply float:left to it.
// What needed changing:
// - consistent use of the jQueryFooter variable (rather than re-selecting the footer to apply the margin-top)
// - changed/simplified the math to calculate the difference, adding s4-mainarea (which floats:left and is not included in bodyContainer)
// - did not force footer to show in dialog boxes (use .ms-dialog #custom-footer {display:none} in CSS to hide)
// http://blog.drisgill.com/2013/01/sticky-footers-in-sharepoint.html
// jQuery.noConflict();