Skip to content

Instantly share code, notes, and snippets.

View vgrem's full-sized avatar
🏠
Working from home

Vadim Gremyachev vgrem

🏠
Working from home
View GitHub Profile
@vgrem
vgrem / filterByMM.php
Created June 8, 2023 17:42
The example demonstrates how to retrieve and filter items by Managed Metadata field (column) value
<?php
require_once './vendor/autoload.php';
$settings = include('./settings.php');
use Office365\Runtime\Auth\ClientCredential;
use Office365\SharePoint\CamlQuery;
use Office365\SharePoint\ClientContext;
import React, { useEffect } from "react";
import { Map, GeoJSON, TileLayer } from "react-leaflet";
import leafletStream from "leaflet-geojson-stream";
function StreamGeoJsonLayer(props) {
const layerRef = React.useRef();
const { url } = props;
useEffect(() => {
const gj = layerRef.current.leafletElement;
leafletStream.ajax(url, gj).on("end", function () {
@vgrem
vgrem / data.json
Last active October 5, 2020 16:47
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
bigcity_red.png
bigcity_green.png
[
{
"id": 1,
"name": "Oslo",
"location": { "lat": 59.923043, "lng": 10.752839 }
},
{
"id": 2,
"name": "Stockholm",
"location": { "lat": 59.339025, "lng": 18.065818 }
@vgrem
vgrem / us-states.json
Created March 28, 2020 12:52
US States TopoJSON file
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vgrem
vgrem / FileUploader.cs
Last active October 4, 2019 16:49
SharePoint Online REST API chunked file upload
using System;
using System.Net;
using Newtonsoft.Json.Linq;
namespace SharePoint.FileOperations
{
class FileUploader
{
public static void ChunkedFileUpload(string webUrl, ICredentials credentials, string sourcePath, string targetFolderUrl, int chunkSizeBytes, Action<long, long> chunkUploaded)
{