Skip to content

Instantly share code, notes, and snippets.

@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;
@alirobe
alirobe / sp2010 full breadcrumb.aspx
Created October 14, 2011 00:51
Full SP2010 Breadcrumb (for master page)
<!--
Preview - http://i.snag.gy/Dd4S4.jpg
-->
<div id="new-breadcrumb" class="s4-notdlg">
<div class="s4-titletext">
<h1 name="onetidProjectPropertyTitle">
<asp:SiteMapPath runat="server" SiteMapProvider="SPContentMapProvider">
<PathSeparatorTemplate>
<span class="s4-nothome s4-bcsep s4-titlesep">
<SharePoint:ClusteredDirectionalSeparatorArrow runat="server"/>
@alirobe
alirobe / spf-dropdown.js
Last active September 27, 2015 18:18
SharePoint Foundation Drop-down Navigation
/*
spfDropDowns v.1 by @alirobe - gist: 1312059
To use this, just structure your top-menu bar links by using a leading '-- '
to denote submenu items, e.g.
Menu Item
-- Submenu Item
Menu Item
-- Submenu Item
-- Submenu Item
@alirobe
alirobe / style library-v5-script-v5.js
Last active September 29, 2015 17:47
kyleschaeffer.com's Responsive SP2010 (sans HTML5, via @alirobe)
// kyleschaeffer.com's Responsive SP2010 (sans HTML5, via @alirobe)
// add me to the bottom of v5.js
// via gist @ http://github.com/alirobe
window.onresize = function(){
var w=800, t=" lt-800 ", cw, h;
h = document.getElementsByTagName("html")[0];
cw = window.outerWidth||h.clientWidth;
if (cw<=w) {if(h.className.indexOf(t)==-1) {h.className+=t}}
else {h.className=h.className.replace(/lt-800/g,'').replace(/[\s]{2,}/g,' ');}
@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();
@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 / 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
Verifying that +alirobe is my blockchain ID. https://onename.com/alirobe
@alirobe
alirobe / SP2010-chromeScrollingFix
Last active January 13, 2017 18:54
Fix an issue where occasionally the JavaScript that runs a SharePoint 2010 page's dynamic elements (ribbon, scrolling, etc) fails to initialise in Webkit browsers.
//via http://withinsharepoint.com/archives/256 or http://withinsharepoint.com/archives/210
if (jQuery.browser.webkit) {
jQuery(document).ready(function () {
var interval;
function loopCheck() {
if (typeof (_spBodyOnLoadWrapper) !== "undefined" && _spBodyOnLoadCalled == false)
_spBodyOnLoadWrapper();
else
window.clearInterval(interval);
@alirobe
alirobe / dotVscodeDir-extensions.json
Created May 17, 2018 05:57
Productive React & TypeScript Settings
{
"recommendations": [
"eg2.tslint",
"rbbit.typescript-hero",
"pmneo.tsimporter",
"esbenp.prettier-vscode",
"christian-kohler.path-intellisense",
"CoenraadS.bracket-pair-colorizer",
"eamodio.gitlens",
"ryu1kn.partial-diff",