This file contains 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
public static void GivePrincipalRoleToItem(SPWeb web, SPListItem item, SPPrincipal principal, string roleDefinitionName) | |
{ | |
if (null == principal) | |
{ | |
throw new ArgumentException(string.Format("Unable to give role '{0}'; passed principal is null.", roleDefinitionName)); | |
} | |
bool exists = false; | |
SPRoleAssignment roleAssignment = null; | |
try |
This file contains 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
public class ProxyHandler : IHttpHandler | |
{ | |
const string SERVER_URL = "http://dev-server"; | |
#region IHttpHandler Members | |
public bool IsReusable | |
{ | |
get { return false; } | |
} |
This file contains 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
$.ajax({ | |
'url': '/_vti_bin/EHI/Users.svc/json/GetCurrentUser', | |
'dataType': 'json', | |
'type': 'GET', | |
'success': function(data) { | |
self.currentUser(new Employee(data.d)); | |
}, | |
'error': function() { | |
console.log("Error getting current user."); | |
} |
This file contains 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
<VirtualHost *> | |
ServerAdmin webmaster@localhost | |
ServerName mysite | |
DocumentRoot /home/kit/code/public_html/mysite | |
<Directory /home/kit/code/public_html/mysite> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride All | |
Order allow,deny | |
allow from all |
This file contains 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
/** | |
* Custom JsRender debug tag | |
* Log a message and an object to the console. | |
* Usage: {{debug #parent message='Inside the for loop'/}} | |
**/ | |
$.views.tags({ | |
debug: function(obj) { | |
var props = this.props; | |
// output a default message if the user didn't specify a message | |
var msg = props.message || 'Debug:'; |
This file contains 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 encodeHTML(str) { | |
return str.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"').replace(/'/g,'''); | |
} | |
var queryXml = $('#tmplQueryXml').render({ | |
'QueryText': $('#txtQueryText').val(), | |
'Count': 100, | |
'StartAt': 1 | |
}); |
This file contains 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
# HandySafeXmlToSkyWalletCsv.py | |
# Convert HandySafe XML to Sky Wallet CSV | |
# Save the HandySafe export as test1.xml (hard coded below) | |
# Then, run: python HandySafeXmlToSkyWalletCsv.py > output.txt | |
# Tested using Python 2.7.4 | |
# Author: Kit Menke (@kitmenke) on 7/30/2013 | |
import csv, xml.etree.ElementTree as ET | |
# CHANGE ME: change HANDY_SAFE_XML with the name of your exported HandySafe XML file |
This file contains 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
private static AdmAuthentication _admAuth = new AdmAuthentication(AdmConstants.CLIENT_ID, AdmConstants.CLIENT_SECRET); | |
protected void Page_Load(object sender, EventArgs e) | |
{ | |
txtAuthToken.Text = _admAuth.GetAccessToken().access_token; | |
txtAuthExpires.Text = _admAuth.GetAccessToken().expires_in; | |
} |
This file contains 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
<script type="text/javascript"> | |
function CustomExecuteFunction() { | |
var self = this; | |
self.context = new SP.ClientContext.get_current(); | |
self.web = context.get_web(); | |
self.currentUser = web.get_currentUser(); | |
context.load(self.currentUser); | |
self.asyncSuccess = function(sender, args) { | |
var user = this.currentUser; |
This file contains 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
ko.validation.rules['multiemail'] = { | |
validator: function (val, validate) { | |
if (!validate) { return true; } | |
var isValid = true; | |
if (!ko.validation.utils.isEmptyVal(val)) { | |
// use the required: true property if you don't want to accept empty values | |
var values = val.split(';'); | |
$(values).each(function (index) { | |
isValid = ko.validation.rules['email'].validator($.trim(this), validate); |
OlderNewer