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
// Retrieve Manager for a username | |
// using REST API | |
var siteUrl = _spPageContextInfo.siteAbsoluteUrl; | |
var accountName = 'domain\\login'; | |
// I suppose you use jQuery | |
$.ajax({ | |
url: siteUrl + "/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v='" + encodeURIComponent(accountName) + "'", | |
method: "GET", | |
headers: { "Accept": "application/json; odata=verbose" }, | |
success: function (data) { |
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
// long version | |
function loadExt(files, after) { | |
var _this=this; | |
_this.files = files; | |
_this.js = []; | |
_this.head = document.getElementsByTagName("head")[0]; | |
_this.after = after || function(){}; | |
_this.loadStyle = function(file) { | |
var link = document.createElement("link"); | |
link.rel = "stylesheet"; |
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
/** | |
* Parse a string to a Date | |
* @param {String} strDate | |
* @param {String} format Supported format including YYYY, YY, MM, M, DD, D, with - and / separators | |
* @return {Date|Throw} the JS Date object, or throw Error("Invalid Date") if strDate is invalid | |
* @compatibility IE9+ | |
* @example | |
* Date.parseFrom("1/10/2017", "MM/DD/YYYY"); // -> new Date(2017,0,10) | |
*/ | |
Date.parseFrom=function(strDate, format) { |
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
// Command: node index.js "http://my.site.com/my_root/my_source_libary/" "http://my.othersite.com/my_root/my_destination_libary/" | |
if (process.argv.length !== 4) throw "ERROR: please provide the source and the destination on the command line"; | |
const colors = require('colors'); | |
// load credentials | |
const credentials = require('../credentials'); | |
const $SP = require('sharepointplus'); | |
const sp = $SP().auth(credentials); | |
var requestdigest = ''; | |
// contains the references to the items to update in the dest lib |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd"> | |
<meta> | |
<author>Johannes Charman</author> | |
<description>JSON pages that need post data (this table is based on htmlpost by Christian Heilmann)</description> | |
<sampleQuery>select * from {table} where url='http://search.twitter.com/search.json' and postdata="q=test"</sampleQuery> | |
<documentationURL></documentationURL> | |
</meta> | |
<bindings> | |
<select itemPath="" produces="XML"> |
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
<?xml version="1.0" encoding="UTF-8" ?> | |
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd"> | |
<meta> | |
<author>Todd Vierling</author> | |
<description>HTML selector that returns a flat, escaped string rather than a node tree. Suitable for use with Pipes and other applications wishing to embed HTML in another XML-like container.</description> | |
<sampleQuery>select * from {table} where url='http://www.yahoo.com/' and xpath='//a'</sampleQuery> | |
</meta> | |
<bindings> | |
<select itemPath="" produces="XML"> | |
<urls> |
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
// npm install castv2-client google-tts-api | |
var Client = require('castv2-client').Client; | |
var client = new Client(); | |
var DefaultMediaReceiver = require('castv2-client').DefaultMediaReceiver; | |
var GoogleTTS = require('google-tts-api'); | |
var host = "192.168.0.13"; // IP Address of the Google Home | |
var text = "Bonjour et bienvenue"; // Text to speach | |
var lang = "fr-FR"; // language | |
GoogleTTS(text, lang, 1) | |
.then(function(url) { |
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
var urlRegex =/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig; | |
function linkify(text, safeText) { | |
safeText = (safeText===false? false : true); | |
if (safeText) text=escapeHtml(text); | |
return text.replace(urlRegex, function(url) { | |
return '<a href="' + url + '">' + url + '</a>'; | |
}); | |
} |
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
const extend=require('extend'); | |
const { sso } = require('node-expose-sspi'); | |
const fetch = require('node-fetch'); | |
var debugMode = false; | |
var globalCredentials = {}; | |
/** | |
* Returns an object of cookies | |
* @param {Array} cookies An array of "cookieName=cookieValue;whatever…" |
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
// this is a simplified example using Vuetify v1 and TipTap v1 | |
<template> | |
<div> | |
<editor-menu-bar :editor="editor" v-else> | |
<div class="menubar" slot-scope="{ commands, isActive }"> | |
<v-tooltip top> | |
<button :class="{ 'menubar__button':true, 'is-active': isActive.bold() }" @click="commands.bold" slot="activator"> | |
<v-icon>format_bold</v-icon> | |
</button> | |
<span>Bold</span> |