Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@neilhoff
neilhoff / gist:6ea98b6c9c2ef2225b9545c11ca34f34
Created January 8, 2021 13:16
Architect when using CORS doesn't allow 'authorization' header
<!doctype html>
<html lang="en">
<head>
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<script>
async function get () {
@neilhoff
neilhoff / GetSiteCollectionSizeAndLocation.ps1
Created May 22, 2015 14:24
SharePoint 2013: Get the size and content database for all site collections in a web application
# Iterate through all site collections in a SharePoint web application and output to a CSV file:
# - Site, Size(B), Size(MB), Size(GB), Content database
$webApp = 'http://webappurl'
$csvPath = 'e:\data.csv'
# Get all the sites in the web app
$sites = Get-SPWebApplication $webApp | Get-SPSite -Limit ALL
# Set the header for the file
@neilhoff
neilhoff / gist:e151c155235f96214750
Created July 24, 2014 20:07
Add a url param to all links on a page
$(document).ready(function() {
var paramToAdd = "function called to fill this variable"
if (paramToAdd.length > 0) {
$("a").attr('href', function (i, h) {
//try catch needed for odd links(Ex: the slider nav squares when using Flexslider)
try {
var invalidLink = h.lastIndexOf("tel:", 0) === 0 || h.lastIndexOf("mailto:", 0) === 0;
if (!invalidLink) {
return h + (h.indexOf('?') != -1 ? "&param=" + paramToAdd : "?param=" + paramToAdd);
}