I hereby claim:
- I am dougludlow on github.
- I am dougludlow (https://keybase.io/dougludlow) on keybase.
- I have a public key whose fingerprint is 5DBF 8468 75A2 2C6C F2EC 9F1E 71C6 8D52 0D1E B6F7
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using umbraco.cms.businesslogic.media; | |
using umbraco.presentation.umbracobase; | |
[RestExtension("Media")] | |
public class SaveMedia | |
{ |
Function Get-EmbeddedCount { | |
Param([string]$path) | |
$embedded = @{} | |
Get-ChildItem $path | ForEach-Object { | |
[xml]$cache = Get-Content $_.FullName | |
$regex = "<(?<tag>iframe|embed|param)(?<space>[\S\s-[>]]*?)(?<attr>src|value)=`"(?<protocol>http:)(?<url>//(.)*?)`"(?<therest>[\S\s-[>]]*?)>" | |
$xpath = "//bodyText" | |
$nodes = $cache.SelectNodes($xpath) | Where-Object { $_.InnerText -match $regex } |
<!-- Youtube Settings --> | |
<provider name="Youtube" type="Umbraco.Web.Media.EmbedProviders.OEmbedVideo, umbraco"> | |
<urlShemeRegex><![CDATA[youtu(?:\.be|be\.com)/(?:(.*)v(/|=)|(.*/)?)([a-zA-Z0-9-_]+)]]></urlShemeRegex> | |
<apiEndpoint><![CDATA[http://www.youtube.com/oembed]]></apiEndpoint> | |
<requestParams type="Umbraco.Web.Media.EmbedProviders.Settings.Dictionary, umbraco"> | |
<param name="iframe">1</param> | |
<param name="format">xml</param> | |
<param name="scheme">https</param> | |
</requestParams> | |
</provider> |
function Update-EmbeddedContent { | |
Param([string]$site) | |
# Replace DLL | |
$source = "Updated\bin\TheFarm.Umbraco.EmbeddedContent.dll" | |
$assembly = (Join-Path $site "bin\TheFarm.Umbraco.EmbeddedContent.dll") | |
Remove-Item $assembly | |
Copy-Item $source -Destination $assembly |
SET NOCOUNT ON | |
DECLARE | |
@table sysname, | |
@sql varchar(2000) | |
SELECT * INTO #tables FROM INFORMATION_SCHEMA.Tables WHERE TABLE_NAME IN ('Post', 'PostArea', 'Comment', 'Location', 'Attachment') | |
SELECT @table = MIN(TABLE_NAME) FROM #tables | |
WHILE @table IS NOT NULL |
REPLACE(REPLACE(REPLACE(SUBSTRING((DT_STR, 30, 1252)GETDATE(), 1, 19 ) , "-", ""), " ", ""), ":", "") |
<?xml version="1.0" encoding="utf-8"?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>The MIT License (MIT)</Title> | |
<Shortcut>mit</Shortcut> | |
<Description>The Open Source MIT License (MIT)</Description> | |
<Author>Douglas Ludlow</Author> | |
<SnippetTypes> | |
<SnippetType>Expansion</SnippetType> |
var old = new Document(1234); | |
var newId = 4321; | |
foreach (var child in old.Children) | |
{ | |
child.Move(newId); | |
} | |
umbraco.library.RefreshContent(); |