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 / LatLng.json
Last active February 10, 2017 12:44
[
"42.3334,-89.1572",
"39.2058,-76.7531",
"39.7751,-86.1322",
"40.4894,-78.3499",
"42.0203,-87.9059",
"36.2673,-86.2912",
"33.6115,-84.3745",
"44.9793,-93.273",
"40.1461,-76.0738",
[
{
"Name": "Oslo",
"Lat": 59.923043,
"Lng": 10.752839
},
{
"Name": "Stockholm",
"Lat": 59.339025,
"Lng": 18.065818
@vgrem
vgrem / setLike.js
Created December 26, 2016 14:23
Demonstrates how to like/unlike resource via SharePoint REST API
var Reputation = Reputation || {};
Reputation = (function () {
function executeJson(options) {
var headers = options.headers || {};
headers["Accept"] = "application/json;odata=verbose";
if (options.method == "POST") {
headers["X-RequestDigest"] = $("#__REQUESTDIGEST").val();
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<table class="uib-timepicker">
<tbody>
<tr class="text-center" ng-show="::showSpinners">
<td class="uib-increment hours"><a ng-click="incrementHours()" ng-class="{disabled: noIncrementHours()}" class="btn btn-link" ng-disabled="noIncrementHours()"
tabindex="-1"><span class="glyphicon glyphicon-chevron-up"></span></a></td>
<td>&nbsp;</td>
<td class="uib-increment minutes"><a ng-click="incrementMinutes()" ng-class="{disabled: noIncrementMinutes()}" class="btn btn-link" ng-disabled="noIncrementMinutes()"
tabindex="-1"><span class="glyphicon glyphicon-chevron-up"></span></a></td>
<td ng-show="showSeconds">&nbsp;</td>
<td ng-show="showSeconds" class="uib-increment seconds"><a ng-click="incrementSeconds()" ng-class="{disabled: noIncrementSeconds()}" class="btn btn-link" ng-disabled="noIncrementSeconds()"
@vgrem
vgrem / Activate-GoogleAnalytics.ps1
Created November 2, 2016 10:24
Register Google Analytics in SharePoint 2010/2013 site
param(
[string]$Url,
[string]$UserName,
[string]$Password,
[string]$Domain,
[string]$Code
)
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client")
{
"d": {
"results": [
{
"__metadata": {
"id": "dc875f81-5d9c-44c9-a4d1-0fba4099d8c0",
"uri": "https://contoso.sharepoint.com/_api/Web/Lists(guid'0d0aaa1b-4e39-4afb-a876-b8a64560029d')/Items(1)",
"etag": "\"1\"",
"type": "SP.Data.InventoryListItem"
},
@vgrem
vgrem / createNewDiscussionReply.js
Created September 12, 2016 12:13
Demonstrates how to create a message (reply) in Discussion Board via SharePoint REST API
function executeJson(options)
{
var headers = options.headers || {};
var method = options.method || "GET";
headers["Accept"] = "application/json;odata=verbose";
if(options.method == "POST") {
headers["X-RequestDigest"] = $("#__REQUESTDIGEST").val();
}
var ajaxOptions =
{
"count": 10785236,
"photos": [
{
"photo_id": 27932,
"photo_title": "Atardecer en Embalse",
"photo_url": "http://www.panoramio.com/photo/27932",
"photo_file_url": "http://mw2.google.com/mw-panoramio/photos/medium/27932.jpg",
"longitude": -64.404945,
"latitude": -32.202924,
[
{
"id": 1,
"latitude": 42.2808256,
"longitude": -83.74303780000002,
"name" : "Ann Arbor",
"address": "Ann Arbor, MI, USA",
"category": "MI"
},
{