Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Vadim Gremyachev vgrem

🏠
Working from home
View GitHub Profile
View places.json
[{"name":"Brisbane","position":{"lat":-27.4704073,"lng":153.0142954}},{"name":"Sidney","position":{"lat":-33.867888,"lng":151.2012372}},{"name":"Perth","position":{"lat":-31.954654,"lng":115.8399823}}]
@vgrem
vgrem / BatchRequest.cs
Last active Oct 19, 2019
BatchRequest class for msgraph-sdk-dotnet
View BatchRequest.cs
using Microsoft.Graph;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
View data.json
[
{ "name" : "Joe Johnson"
, "values": [
{
"from date": "jan-2000"
, "to date": "jun-2002"
, "Role": "VP of Product"
, "Company": "A Company"
},
View data,json
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
View locations.json
[
{
"acf": {
"place_latitude": "-22.695754",
"place_longitude": "118.269081",
"place_short-description": "Karijini National Park"
},
"id": 12,
"parent": 10,
"title": {
View pharmacy.geojson.js
ar pharmacy = {
"type": "FeatureCollection",
"name": "pharmacy",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "KMIST_TEMP_ID": "KTMPVN12119", "ID POP": null, "type": "2018", "pop": "No", "Timestamp": "2018\/07\/11 22:50:00", "panel": null, "Name": "Nha Thuoc An Binh", "city": "Ho Chi Minh", "district": "Thu Duc", "ward": "Linh Trung", "name_full": "Ho Chi Minh ,Nha Thuoc An Binh ,Thu Duc, Linh Trung", "lat": 10.8539167, "lon": 106.7716921, "geo": "106.7716921,10.8539167", "amenity": "pharmacy" }, "geometry": { "type": "Point", "coordinates": [ 106.7716921, 10.8539167 ] } },
{ "type": "Feature", "properties": { "KMIST_TEMP_ID": "KTMPVN12144", "ID POP": 17019, "type": "2018", "pop": "yes", "Timestamp": "2017\/10\/15 18:05:00", "panel": null, "Name": "Nha Thuoc Thuy Nguyen", "city": "Ho Chi Minh", "district": "Binh Thanh", "ward": "21", "name_full": "Ho Chi Minh ,Nha Thuoc Thuy Nguyen ,Binh Thanh,
View JsonBatchSupport.cs
using Microsoft.Graph;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
View data.json
{
"lat": "51.678418",
"lng": "7.809007"
}
@vgrem
vgrem / addFieldUserValue.js
Created Sep 15, 2018
Demonstrates how to add UserFieldValue for a Group as value in ListItem via SharePoint JSOM API
View addFieldUserValue.js
function addListItem(list, properties) {
let ctx = list.get_context();
let itemCreateInfo = new SP.ListItemCreationInformation();
let listItem = list.addItem(itemCreateInfo);
for (let name in properties) {
listItem.set_item(name, properties[name])
}
listItem.update();
return executeQuery(ctx);
}
@vgrem
vgrem / getWebParts.js
Created Jul 27, 2018
How to retrieve web parts along with web part type using SharePoint JSOM API
View getWebParts.js
async function executeQuery(context) {
return new Promise((resolve, reject) => {
context.executeQueryAsync(function () {
resolve();
}, function (sender, args) {
reject(args);
});
});
}