Skip to content

Instantly share code, notes, and snippets.

View dcouto's full-sized avatar

Douglas Couto dcouto

  • Rightpoint
  • Boston, MA
View GitHub Profile
@dcouto
dcouto / SassMeister-input-HTML.html
Created May 15, 2015 13:19
Generated by SassMeister.com.
<h1>Susy Grid System Example</h1>
<div class="twelve-columns">
<div>a few words</div>
<div>a few words</div>
<div>a few words</div>
<div>a few words</div>
<div>a few words</div>
<div>a few words</div>
<div>a few words</div>
@dcouto
dcouto / SassMeister-input-HTML.html
Last active August 29, 2015 14:21
Generated by SassMeister.com.
<h1>Susy Grid System Example</h1>
<div class="twelve-columns">
<div>
<div>some content would go here</div>
</div>
<div>
<div>some content would go here</div>
</div>
<div>
using Sitecore.Caching;
using Sitecore.Caching.Generics;
using Sitecore.Configuration;
using Sitecore.Diagnostics;
using Sitecore.Sites;
using System;
using System.Collections;
namespace MyApp.Publishing
{
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<events>
<event name="publish:end:remote">
<handler type="MyApp.Publishing.APICaller, MyApp.Publishing" method="CallAPIMethod" />
</event>
</events>
</sitecore>
</configuration>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<events>
<event name="publish:end:remote">
<handler type="MyApp.Publishing.APICaller, MyApp.Publishing" method="CallAPIMethod" />
</event>
</events>
</sitecore>
</configuration>
using Sitecore;
using Sitecore.Data.Items;
using Sitecore.Jobs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
namespace SitecoreCookbook.Tasks
{
SELECT
D.name,
F.Name AS FileType,
F.physical_name AS PhysicalFile,
F.state_desc AS OnlineStatus,
CAST((F.size*8)/1024 AS int) AS [FileSize (MB)]
--CAST(F.size*8 AS VARCHAR(32)) as SizeInBytes
FROM
sys.master_files F
INNER JOIN sys.databases D ON D.database_id = F.database_id
$items = Get-Item master: -Query "/sitecore//*"
Write-Host $items.Length
$items | ForEach-Object {
try {
[Sitecore.Globals]::LinkDatabase.UpdateReferences($_)
# [Sitecore.Globals]::LinkDatabase.UpdateItemVersionReferences($_)
}
catch {
EXEC msdb.dbo.sp_delete_database_backuphistory @database_name = N'prefix_Core'
GO
USE [master]
GO
DROP DATABASE [prefix_Core]
GO
EXEC msdb.dbo.sp_delete_database_backuphistory @database_name = N'prefix_EXM.Master'
GO
USE [master]
$allItems = Get-ChildItem -Path '/sitecore/content/Default Datasources/Default Featured Data List' -Recurse
ForEach ($item in $allItems) {
# Write-Host $item.FullPath
$item.Editing.BeginEdit()
$item["__Read Only"] = "1"
$item.Editing.EndEdit()
}