Skip to content

Instantly share code, notes, and snippets.

View sebastiantecsi's full-sized avatar

Sebastian Tecsi sebastiantecsi

View GitHub Profile
@sebastiantecsi
sebastiantecsi / InstallSitecoreInstance.ps1
Created January 7, 2018 12:27 — forked from jisha86swamy/InstallSitecoreInstance.ps1
Script file to install sitecore 9 instance
#define parameters
$prefix = "xp062"
$SqlServer = "sql server"
$SqlAdminUser = "admin user name"
$SqlAdminPassword="admin user password"
$SolrVersionNumber ='6.6.2'
$KeyToolFilePath ='C:\Program Files (x86)\Java\jre1.8.0_121\bin\keytool.exe'
$SQLCommandBinFolderPath ='C:\Program Files (x86)\Java\jre1.8.0_121\bin\keytool.exe'
Param(
$solrVersion = "6.6.2",
$installFolder = "d:\solr",
$solrPort = "8983",
$solrHost = "solr",
$solrSSL = $true,
$nssmVersion = "2.24",
$JREVersion = "1.8.0_151"
)
@sebastiantecsi
sebastiantecsi / msbuild.ps1
Created February 27, 2019 10:09 — forked from kamsar/msbuild.ps1
PowerShell to resolve MSBuild.exe on VS2017 or VS2015 (or with Build Tools 2015)
function Resolve-MsBuild {
$msb2017 = Resolve-Path "${env:ProgramFiles(x86)}\Microsoft Visual Studio\*\*\MSBuild\*\bin\msbuild.exe" -ErrorAction SilentlyContinue
if($msb2017) {
Write-Host "Found MSBuild 2017 (or later)."
Write-Host $msb2017
return $msb2017
}
$msBuild2015 = "${env:ProgramFiles(x86)}\MSBuild\14.0\bin\msbuild.exe"
@sebastiantecsi
sebastiantecsi / Sitecore-InvalidContentFieldData.sql
Created January 5, 2020 13:36 — forked from mikaelnet/Sitecore-InvalidContentFieldData.sql
Finds invalid content in the Sitecore database
DECLARE @SharedFieldId UniqueIdentifier = '{BE351A73-FCB0-4213-93FA-C302D8AB4F51}' /* Shared checkbox */
DECLARE @UnversionedFieldId UniqueIdentifier = '{39847666-389D-409B-95BD-F2016F11EED5}' /* unversioned checkbox */
DECLARE @TemplateFieldId UniqueIdentifier = '{455A3E98-A627-4B40-8035-E683A0331AC7}' /* Template field */
-- Find all templates WHERE both "Unversioned" AND "Shared" is selected:
-- "Shared" will have precedense, so the "Unversioned" checkbox can be removed
SELECT * FROM SharedFields
WHERE FieldId=@UnversionedFieldId AND [Value] = '1'
AND ItemId IN (SELECT ItemId FROM SharedFields WHERE FieldId=@SharedFieldId AND [Value]='1')
@sebastiantecsi
sebastiantecsi / delete_branches_older_than.sh
Created April 10, 2020 13:26 — forked from countless-integers/delete_branches_older_than.sh
Script to delete branches older than a certain date
#!/bin/bash
dry_run=0
usage()
{
cat << EOF
usage: $0 [-n] ["string_to_date"]
Remove branches older than specified, human-readable date passed as a param
<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Import Namespace="Sitecore.Configuration" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Xml" %>
<%
XmlDocument configuration = Factory.GetConfiguration();
Response.ContentType = "application/xml";
Response.Write(configuration.OuterXml);
<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Import Namespace="Sitecore.Configuration" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Xml" %>
<%
XmlDocument configuration = Factory.GetConfiguration();
Response.ContentType = "application/xml";
Response.Write(configuration.OuterXml);

This uses Chocolatey and Boxstarter to install a loadout for Sitecore/.NET development on a new computer. Click the link below to start a click-to-run that does all the things. It's that easy. Fork the gist and alter the link below to customize for your own usage!

Click here to start install

import React, { useEffect, useState } from 'react';
import { withSitecoreContext, dataApi, Placeholder } from '@sitecore-jss/sitecore-jss-react';
import { dataFetcher } from './dataFetcher';
import config from './temp/config';
const HybridPlaceholder = ({
name,
rendering,
sitecoreContext,
}) => {
@sebastiantecsi
sebastiantecsi / JssFieldsExtender.cs
Created January 12, 2023 05:16 — forked from IvanLieckens/JssFieldsExtender.cs
Sitecore JSS GraphQL schema extension to output fields in JSS format
using GraphQL.Types;
using Newtonsoft.Json;
using Sitecore.Configuration;
using Sitecore.Data.Items;
using Sitecore.Data.Fields;
using Sitecore.Diagnostics;
using Sitecore.LayoutService.Serialization.FieldSerializers;
using Sitecore.LayoutService.Serialization.ItemSerializers;
using Sitecore.LayoutService.Serialization.Pipelines.GetFieldSerializer;
using Sitecore.Services.GraphQL.Content.GraphTypes;