This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var argv = require('argv'); | |
var https = require('https'); | |
var xml2js = require('xml2js'); | |
var inspect = require('eyes').inspector({maxLength: false}); | |
var gpio = require('gpio'); | |
var xmlParser = new xml2js.Parser(); | |
var teamCityHost = 'your team city host'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class EnumerableExtensions | |
{ | |
public static IEnumerable<T> ToEnumerable<T>(this T item, bool nullAsEmpty = true) | |
{ | |
if (EqualityComparer<T>.Default.Equals(item, default(T)) && nullAsEmpty) | |
yield break; | |
yield return item; | |
} | |
public static bool None<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class IPAddressExtensions | |
{ | |
/// <summary> | |
/// Tests if a given IPv4 address is within any of the private | |
/// IP address ranges, 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16 | |
/// </summary> | |
/// <param name="address"></param> | |
/// <returns>True if the address is private, otherwise false. | |
/// Note: IPv6 address always returns false</returns> | |
/// <exception cref="NotSupportedException">For unknown address families (other than IPv4 and IPv6)</exception> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class LevenshteinDistanceComputer | |
{ | |
public static int LevenshteinDistance(this string s, string t) | |
{ | |
return Compute(s, t); | |
} | |
public static int Compute(string s, string t) | |
{ | |
if (string.IsNullOrEmpty(s)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Update-MediaItem { | |
[CmdletBinding()] | |
param( | |
[Parameter(Position=0, Mandatory=$true, ValueFromPipeline=$true)] | |
[ValidateNotNullOrEmpty()] | |
[string]$filePath, | |
[Parameter(Position=1, Mandatory=$true)] | |
[ValidateNotNullOrEmpty()] | |
[string]$mediaPath) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select 'Database Name: ', db_name() | |
set nocount on | |
if exists(select name from tempdb..sysobjects where name='##tmp') drop table ##tmp | |
create table ##tmp(nam varchar(50), rows int, res varchar(15),data varchar(15),ind_sze varchar(15),unsed varchar(15)) | |
go | |
declare @tblname varchar(50) | |
declare tblname CURSOR for select name from sysobjects where xtype='U' | |
open tblname | |
Fetch next from tblname into @tblname | |
WHILE @@FETCH_STATUS = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @SearchStr nvarchar (100) | |
SET @SearchStr = 'string to find' | |
CREATE TABLE #Results ( ColumnName nvarchar( 370), ColumnValue nvarchar(3630 )) | |
SET NOCOUNT ON | |
DECLARE @TableName nvarchar (256), @ColumnName nvarchar( 128), @SearchStr2 nvarchar(110 ) | |
SET @TableName = '' | |
SET @SearchStr2 = QUOTENAME( '%' + @SearchStr + '%','''' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Management.Automation; | |
using Sitecore.Data.Items; | |
[OutputType(typeof(Item)), Cmdlet("Touch", "Item")] | |
public class TouchItem : Cmdlet | |
{ | |
[Parameter(ValueFromPipeline = true, ValueFromPipelineByPropertyName = true)] | |
public Item Item { get; set; } | |
protected override void ProcessRecord() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Lists the items with broken links searching all or the latest version in the current language. | |
This is an update of the original Broken Links report created by the authors of SPE: | |
https://github.com/SitecorePowerShell/Console | |
This versions has the following changes | |
* Ability to ignore checking broken links in the renderings field. (Makes sense in come clone scenarios) | |
* Supports checking external links of field type "General Link with Search" | |
* Supports checking external protocol independent links (URL's starting with //) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Sitecore; | |
using Sitecore.Collections; | |
using Sitecore.ContentSearch; | |
using Sitecore.Data; | |
using Sitecore.Data.Items; | |
using Sitecore.Diagnostics; |
OlderNewer