Skip to content

Instantly share code, notes, and snippets.

function Set-SPUniquePermission {
<#
.Synopsis
Sets unique permissions for lists adn document libraries
.Description
It breaks the permissions.
.EXAMPLE
Set-OIPSPUniquePermission -Url https://intranet.contoso.com/news/Lists/Notifications -GroupName "Editors" -PermissionLevel "Design"
Breaks permission inheritance on the list Notifications, copies permissions from the parent web, gives Editors group the permission level Design
1
00:00:37,245 --> 00:00:39,496
Куккук йӑвви
2
00:02:16,928 --> 00:02:18,720
-Ырӑ ир, Ратчет аппа.
-Ырӑ ир.
3
@mirontoli
mirontoli / stop-sp.ps1
Created March 4, 2015 14:28
Stop SharePoint Services
#http://blogs.msdn.com/b/russmax/archive/2013/04/01/why-sharepoint-2013-cumulative-update-takes-5-hours-to-install.aspx
#user: anatoly (full control on web app, farm admin)
#######
# SEARCH
#######
$ssa = get-spenterprisesearchserviceapplication
$ssa.pause()
#wait
@mirontoli
mirontoli / RenameFiles.ps1
Created June 27, 2015 16:02
Rename Images
<#
.Synopsis
This script renames pictures based on the datetime they were taken
.Description
The script is inspired by
http://blog.cincura.net/233463-renaming-files-based-on-exif-data-in-powershell/
http://blogs.technet.com/b/heyscriptingguy/archive/2014/02/06/use-powershell-to-find-metadata-from-photograph-files.aspx
.Example
...
.Parameter Folder
function toArray(list) {
return Array.prototype.slice.call(list);
}
//empty head
document.head.innerHTML = "";
//http://stackoverflow.com/a/3593250
function removeAllAttrs(element) {
for (var i= element.attributes.length; i-->0;) {
var attr = element.attributes[i];
if (attr.name !== "dir") {
@mirontoli
mirontoli / Modernizr placeholder
Created March 25, 2012 22:50 — forked from athanassiadis/Modernizr placeholder
Modernizr placeholder
if (!Modernizr.input.placeholder){
$('input[type=text]').each( function(){
$(this).attr('value', $(this).attr('placeholder') )
.focus(function(){
var ph = $(this).attr('value');
$(this).attr('value','')
.blur( function(){
if($(this).attr('value').length < 1 ){
$(this).attr('value', ph);
}
@mirontoli
mirontoli / geo.html
Created May 12, 2012 06:58
geolocation test
<!DOCTYPE html>
<!-- Comes from http://zeeshanakhter.com/2012/03/15/find-out-your-visitors-position-using-html5-geolocation/ -->
<html>
<head>
<title>HTML5 Geolocation</title>
<script src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script>
// Integration with google maps
function loadMap(lat, lng) {
var latlng = new google.maps.LatLng(lat, lng);
@mirontoli
mirontoli / addScript.js
Last active October 4, 2015 19:48
sharepoint cdn js template
/*
* Anatoly Mironov http://sharepointkunskap.wordpress.com, http://www.bool.se
* Use this script to add your js files to your page in the console dynamically
* Don't use it in the production, just for testing
*/
function addScript(url) {
var script = document.createElement("script");
script.setAttribute("type","text/javascript");
//Conditionally load jQuery
//inspired by http://www.smashingmagazine.com/2010/05/23/make-your-own-bookmarklets-with-jquery/
function myOnLoadEvent() {
jQuery(document).ready(function($) {
alert('your code here');
});
}
@mirontoli
mirontoli / fancybox-resize.js
Created July 3, 2012 06:12
fancybox resize
function adjustHeight() {
if (window.parent && window.parent.jQuery) {
var content = jQuery("#content");
if (content) {
var height = content.height() + 1;
window.parent.jQuery("#fancybox-content").height(height);
}
}
}
jQuery(window).load(adjustHeight);