This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function OnSuccess(sender, args) { | |
alert("Success!"); | |
} | |
function OnFail(sender, args) { | |
alert("Fail: " + args.get_message() + "\n" + args.get_stackTrace()); | |
} | |
function ActivateFeature(url,guid) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void removeMasterPage(object sender, EventArgs e) | |
{ | |
var url = "<URL to site>" | |
using (ClientContext clientContext = new ClientContext(url)) | |
{ | |
Site spsite = clientContext.Site; | |
FeatureCollection siteFeatures = spsite.Features; | |
clientContext.Load(siteFeatures); | |
Guid masterPageFeatureGuid = new Guid("efcd0dac-835c-40ca-af13-c868d6cc13db"); | |
siteFeatures.Remove(masterPageFeatureGuid, true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Win7 Powershell script to resize Minecraft to 1280x720 (HD for fraps youtube capture) | |
# use by typing the following at a command prompt: | |
# > PowerShell -ExecutionPolicy Bypass -File minecraft-sethd.ps1 | |
# refs: | |
# http://stackoverflow.com/questions/2556872/how-to-set-foreground-window-from-powershell-event-subscriber-action | |
# http://richardspowershellblog.wordpress.com/2011/07/23/moving-windows/ | |
# http://www.suite101.com/content/client-area-size-with-movewindow-a17846 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("<param name="wmode" value="transparent" />").insertBefore($(".ctl00_ctl50_g_d370373b_d026_4d10_95e6_b036fd690c31").contents().find('param.name:contains("allowFullScreen")')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
While ((Get-SPTimerJob | ?{ $_.Name -like "*solution-deployment*" }) -ne $null) {Write-Host -NoNewLine .;Start-Sleep -s 2} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$web = Get-SPWeb http://demo2010a:20905 | |
$pages = "http://demo2010a:20905/Pages/TvAndRadioAlerts.aspx","http://demo2010a:20905/Pages/Systems.aspx" | |
$pages | ForEach-Object { | |
$item = $web.GetListItem($_) | |
if ($item.File.CheckOutType -ne "None") | |
{ | |
$item.File.CheckIn("Automatically checked in by Powershell", "MajorCheckIn"); | |
} | |
if ($item.Versions[0].Level -ne "Published") | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function CloseCallback(result, target) | |
{ | |
if(result === SP.UI.DialogResult.OK) | |
{ | |
$('#canceledDiv').hide(); | |
$('#displayDiv').hide(); | |
$('#thankYouDiv').show(); | |
//window.location.replace("http://stackoverflow.com"); | |
} | |
if(result === SP.UI.DialogResult.cancel) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF IN A MODAL DIALOG | |
$(".ms-dlgFrame").contents().find('td.ms-formlabel:contains("Hospital")').siblings('.ms-formbody').text().length; | |
OTHERWISE: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Create a standard SPWeb object with admin credentials | |
$spweb = get-spweb http://url | |
#grab the user you want to instanciate under | |
$usr = $spweb.allusers | ? {$_.displayname -like "User Name"} | |
#make the user token accessable | |
$token = $usr.UserToken |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require("http"); | |
http.createServer(function(request, response) { | |
response.writeHead(200, {"Content-Type": "text/plain"}); | |
response.write("Hello World"); | |
response.end(); | |
}).listen(8888); |