Skip to content

Instantly share code, notes, and snippets.

@vaderj
vaderj / disableCalendarDblClick.js
Created June 27, 2018 16:20
Disable the double click event listeners for the SharePoint calendar (that creates a new item) #Javascript #SharePoint
//Disable the dblclick event listener which creates a new item on the calendar
ExecuteOrDelayUntilScriptLoaded(MyCalendarHook,'SP.UI.ApplicationPages.Calendar.js');
function MyCalendarHook(){
var calendarCreate = SP.UI.ApplicationPages.CalendarContainerFactory.create;
SP.UI.ApplicationPages.CalendarContainerFactory.create = function (elem,cctx,viewType,date,startupData) {
cctx.canUserCreateItem = false;
calendarCreate(elem, cctx, viewType, date, startupData);
}
}
@vaderj
vaderj / reg-ex.notepad++.txt
Last active February 27, 2020 19:05
#regEx #notepad++ RegEx's that work with Notepad++
Select everything before the occurance: ^(.*?)\
Usage: (find and replace everything before and including "VM911.1") : ^(.*?)\VM911:1
@vaderj
vaderj / cheatsheet
Last active February 25, 2020 22:19
#git Cheat sheet and troubleshooting git
From the root of your project folder
1.) git init
2.) git add .
3.) git commit -m "initial commit"
(the next two are from DevOps once the Repo has been established)
4.) git remote add origin https://[email protected]/tenant/ProjectName/_git/ProjectName
5.) git push -u origin –all
To update the repo from your local project :
@vaderj
vaderj / cheatsheet
Last active February 27, 2020 16:17
#node.js #npm cheatsheet NPM & Node.js cheatsheet
#If NPM is throwing errors about permissions issues:
npm config set unsafe-perm=true
# error : "Error: EPERM: operation not permitted, rename" ... includes cache clear twice
npm cache clean --force
npm install -g npm@latest --force
npm cache clean --force