Skip to content

Instantly share code, notes, and snippets.

View ITJoePC's full-sized avatar

JoePC ITJoePC

View GitHub Profile
@joerodgers
joerodgers / dashboard.js
Last active February 26, 2022 05:30
JSOM code that will populate a dropdown box with field values from a SharePoint List.
<script type="text/javascript">
var updateQueryString = null;
$(document).ready(function() {
// customize these variables
var _dropDownId = "applicationNames"; // this must match the ID of the select element placed on the wiki page (<select id="applicationNames">></select>)
var _listTitle = "Applications"; // title of the list that stores the items to display in the list
var _displayFieldInternalName = "App_x0020_Name"; // this the internal name of the field that stores the values to display in the dropdown
@koohq
koohq / sp-request.js
Created January 8, 2018 18:53
Provides method for executing SharePoint REST API (based on SP.RequestExecutor.js)
/**
* sp-request.js
*
* (c) 2018 koohq. Licensed under CC0.
* https://creativecommons.org/publicdomain/zero/1.0/legalcode
*/
var SPRequest = (function() {
// constructor
function SPRequest(webUrl) {
this.webUrl = webUrl;
@raecoo
raecoo / console.save.js
Last active June 23, 2024 09:05
Save JSON object to file in Chrome Devtool
// e.g. console.save({hello: 'world'})
(function(console){
console.save = function(data, filename){
if(!data) {
console.error('Console.save: No data')
return;
}
if(!filename) filename = 'console.json'
if(typeof data === "object"){
data = JSON.stringify(data, undefined, 4)
@richard512
richard512 / waldo.js
Created January 18, 2017 20:53
Waldo JS -- Find Strings in JS DOM
/*
Author: Angus Croll
Found at: https://javascriptweblog.wordpress.com/2011/07/11/waldo-search-the-javascript-runtime-in-under-1-kb/
MINIFIED AS A BOOKMARKLET:
javascript:(function(){var c=function(d,e,f){var f=f||{};var i=f.obj||window;var h=f.path||((i==window)?"window":"");var g=Object.keys(i);g.forEach(function(j){if((b[d]||d)(e,i,j)){console.log([h,".",j].join(""),"->",["(",typeof i[j],")"].join(""),i[j])}if(Object.prototype.toString.call(i[j])=="[object Object]"&&(i[j]!=i)&&h.split(".").indexOf(j)==-1){c(d,e,{obj:i[j],path:[h,j].join(".")})}})};var a=function(d,g,e,f){(!g||typeof e==g)?c(d,e,f):console.error([e,"must be",g].join(" "))};var b={name:function(d,e,f){return d==f},nameContains:function(d,e,f){return f.indexOf(d)>-1},type:function(d,e,f){return e[f] instanceof d},value:function(d,e,f){return e[f]===d},valueCoerced:function(d,e,f){return e[f]==d}};window.find={byName:function(d,e){a("name","string",d,e)},byNameContains:function(d,e){a("nameContains","string",d,e)},byType:function(d,e){a("typ
@wpsmith
wpsmith / Repair-SPDistributedCache.ps1
Last active May 17, 2023 08:53
PowerShell: Repair SharePoint Distributed Cache Service Instance
<#
.Synopsis
Repairs the Distributed Cache on a Server.
.Description
Repairs the Distributed Cache on a Server by removing the current Distributed Cache Service instance.
.Parameter Server ("ServerName")
The Server running Distributed Cache Service
Type: String
@paulirish
paulirish / bling.js
Last active July 3, 2024 20:45
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@frankmeola
frankmeola / XMLMinifier.cs
Last active August 24, 2022 10:11
A simple XML minifier in C#.
using System.IO;
using System.Text;
using System.Xml;
namespace XMLMinifier
{
/// <summary>
/// Config object for the XML minifier.
/// </summary>
public class XMLMinifierSettings
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@xinmyname
xinmyname / wsputil.psm1
Created March 17, 2011 21:00
WSP Utilities for SharePoint
# Magic fairy dust for working with WSPs and SharePoint 2010 in PowerShell
# So far, I've only tested this with event receivers, but I'll expand it
# as necessary.
function Get-WSPFeatures {
param($wspFilename = $(throw "Please specify a WSP file."))
$wspPath = (gci $wspFilename).FullName
$wsp = _wspExtractWSP $wspPath