Skip to content

Instantly share code, notes, and snippets.

Avatar
🌊
Working from sea

Sergey Tihon sergey-tihon

🌊
Working from sea
View GitHub Profile
View gist:7d0ca6fdb9d2703d0b36
public List<Dependency> GetDependency(Tree tree)
{
var tlp = new PennTreebankLanguagePack();
var gsf = tlp.grammaticalStructureFactory();
var gs = gsf.newGrammaticalStructure(tree);
var dependencies = gs.typedDependenciesCollapsedTree();
return (from TypedDependency dependency in dependencies.toArray()
select new Dependency
{
@sergey-tihon
sergey-tihon / gist:51e21e328454567594f4
Created Nov 13, 2014
Joke radio powered by COM Type Provider
View gist:51e21e328454567594f4
#r "../packages/FSharp.ComProvider.1.0.0-pre1/lib/net40/FSharp.ComProvider.dll"
#r @"../packages/FSharp.Data.2.1.0/lib/net40/FSharp.Data.dll"
open FSharp.Data
type SpeechService = TypeLib.``Microsoft Speech Object Library``.``5.4``
let speech = SpeechService.SpVoiceClass()
type js = JsonProvider<"""{ "type": "success", "value": { "id": 42, "joke": "Joke here." } }""" >
let getJoke num =
View gist:419589f96f8de1193010
// include Fake libs
#r @"c:\Project\FAKE.Deploy\bin\FAKE\tools\FakeLib.dll"
open Fake
open System
open System.IO
let targetDirectory = @"c:\Project\Service.MSO"
let runScript file =
if File.Exists file then
View search.js
FST_PreviewRequests = [];
function FST_RegisterDocPreviewFetch(a) {
ULShpi: ;
FST_PreviewRequests.push(a)
}
var gTotReq = 0,
gTotReqSent = 0;
function FST_StartDocPreviewFetch(b, c) {
View init.js
function navigateMailToLink(a) {
ULSA13: ;
window.location = "mailto:?body=" + escapeProperly(a)
}
View init.js
function GetUrlKeyValue(d, e, a) {
ULSA13: ;
var c = "";
if (a == null) a = window.location.href + "";
var b;
b = a.indexOf("#");
if (b >= 0) a = a.substr(0, b);
b = a.indexOf("&" + d + "=");
if (b == -1) b = a.indexOf("?" + d + "=");
if (b != -1) {
View masterpage.master
before:
<body onload="javascript:if (typeof(_spBodyOnLoadWrapper) != 'undefined') _spBodyOnLoadWrapper();">
after:
<script type="text/javascript">
var attempts_remain = 200;
function _lazySpBodyOnLoadWrapper() {
if (typeof(_spBodyOnLoadWrapper) == 'undefined' || !(document.readyState === "complete")) {
if (attempts_remain > 0) {
attempts_remain--;
@sergey-tihon
sergey-tihon / gist:2838208
Created May 30, 2012
How to update SPListItem Created/Modified date
View gist:2838208
using System;
using Microsoft.SharePoint;
namespace EPAM.USPS.SharePoint.Core.Utilities.Specific
{
public class ListItemPropertySet
{
public ListItemPropertySet()
{
}
View gist:2888161
open System.IO;
let rec getAllDirectories dir =
Directory.GetDirectories(dir)
|> Array.collect getAllDirectories
|> Array.append [|dir|]
let directoryName = System.Environment.GetCommandLineArgs().[1]
@sergey-tihon
sergey-tihon / SourceDocumentBuilder.cs
Created Sep 28, 2012
ISource for DocumentBuilder
View SourceDocumentBuilder.cs
/***************************************************************************
Copyright (c) Microsoft Corporation 2011.
This code is licensed using the Microsoft Public License (Ms-PL). The text of the license can be found here:
http://www.microsoft.com/resources/sharedsource/licensingbasics/publiclicense.mspx
***************************************************************************/