Skip to content

Instantly share code, notes, and snippets.

View aravindmp's full-sized avatar

Aravind Murugesan aravindmp

View GitHub Profile
@aravindmp
aravindmp / itemsecurity.ps1
Created May 12, 2017 02:13
Powershell for SharePoint item level security
$listWeb = Get-SPWeb -Identity $url
$lst = $listWeb.Lists.TryGetList($listName)
if($lst -ne $null)
{
#Read all items = 1. Read items that were created by the user = 2
$lst.ReadSecurity =2
#Create and edit all items = 1. Create items and edit items that were created by the user =2
$lst.WriteSecurity =2
$lst.NoCrawl = $true;
$lst.EnableAttachments = $false;
@aravindmp
aravindmp / chainpromieses.js
Created May 12, 2017 02:11
Angularjs sequential chaining promises
var listOfItems = [1, 2, 3, 4, 5];
// Creating an empty initial promise that always resolves itself.
var promise = $q.all([]);
// Iterating list of items.
angular.forEach(listOfItems, function (item) {
promise = promise.then(function () {
return $timeout(function () {
console.log('Item executed: ' + item);