Skip to content

Instantly share code, notes, and snippets.

View jespa007's full-sized avatar

Jordi Espada jespa007

View GitHub Profile
@keathmilligan
keathmilligan / msgraph-list-contents.py
Last active April 18, 2023 14:55
List the contents of a SharePoint folder using Microsoft Graph with MSAL
import requests
import msal
import atexit
import os.path
import urllib.parse
TENANT_ID = '<your tenant id>'
CLIENT_ID = '<your application id>'
SHAREPOINT_HOST_NAME = 'yourcompany.sharepoint.com'
SITE_NAME = '<your site name>'
@composite
composite / json.stringify.js
Created January 13, 2014 08:26
JSON stringify with escape unicode characters. http://stackoverflow.com/a/4901205/489575
function JSON_stringify(s, emit_unicode)
{
var json = JSON.stringify(s);
return emit_unicode ? json : json.replace(/[\u007f-\uffff]/g,
function(c) {
return '\\u'+('0000'+c.charCodeAt(0).toString(16)).slice(-4);
}
);
}