Skip to content

Instantly share code, notes, and snippets.

View sergey-tihon's full-sized avatar
🦀

Sergey Tihon sergey-tihon

🦀
View GitHub Profile
@sergey-tihon
sergey-tihon / search.js
Created March 26, 2012 15:16
preview fetching
FST_PreviewRequests = [];
function FST_RegisterDocPreviewFetch(a) {
ULShpi: ;
FST_PreviewRequests.push(a)
}
var gTotReq = 0,
gTotReqSent = 0;
function FST_StartDocPreviewFetch(b, c) {
@sergey-tihon
sergey-tihon / init.js
Created March 27, 2012 11:56
e-mail a link
function navigateMailToLink(a) {
ULSA13: ;
window.location = "mailto:?body=" + escapeProperly(a)
}
@sergey-tihon
sergey-tihon / init.js
Created March 27, 2012 12:06
GetUrlKeyValue
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) {
@sergey-tihon
sergey-tihon / masterpage.master
Created March 27, 2012 16:19
script loading
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 18:41
How to update SPListItem Created/Modified date
using System;
using Microsoft.SharePoint;
namespace EPAM.USPS.SharePoint.Core.Utilities.Specific
{
public class ListItemPropertySet
{
public ListItemPropertySet()
{
}
/**************************************************************************************************
* SuperSDG v2.2 release *
* Copyright (c) 2002-2008 Ravent *
* All rights reserved *
* Нарушение авторских прав карается жесотким и мучительным угрызением совести. *
**************************************************************************************************/
#pragma comment (lib,"glut32.lib")
#pragma comment (lib,"glaux.lib")
#include <gl/glaux.h>
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 September 28, 2012 13:41
ISource for DocumentBuilder
/***************************************************************************
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
***************************************************************************/
@sergey-tihon
sergey-tihon / TableCellSource.cs
Created September 28, 2012 13:47
Table Cell Source for Document Builder
public class TableCellSource : ISource
{
public WmlDocument WmlDocument { get; set; }
public bool KeepSections { get; set; }
public string InsertId { get; set; }
public int TableNum { get; set; }
@sergey-tihon
sergey-tihon / gist:3894956
Created October 15, 2012 20:01
ADO.NET Table Columns Names
namespace ADOConsoleApplication
{
using System;
using System.Data;
using System.Data.SqlClient;
class Program
{
static void Main(string[] args)
{