This gist has been expanded to a full project repository.
Please go to: https://github.com/leekelleher/umbraco-package-ideas
| <content name="script"> | |
| <script type="text/coffeescript"> | |
| $().ready -> | |
| $("*[data-uri]").each (el) -> | |
| rendertemplate = Tempo.prepare(el); | |
| uri = el.attribute "data-uri" | |
| refresh = el.attribute "data-refresh" | |
| $.retrieveJSON uri , {}, (data) -> | |
| rendertemplate.render data |
| -- Uncomment below to verify the number of nodes returned is the same as the number of nodes that is in the Recycle Bin | |
| -- SELECT * FROM umbracoNode WHERE path LIKE '%-20%' AND id != -20 | |
| -- Delete all 'related' nodes and table contents... | |
| DELETE FROM cmsPreviewXml WHERE nodeId IN (SELECT id FROM umbracoNode WHERE path LIKE '%-20%' AND id != -20) | |
| DELETE FROM cmsContentVersion WHERE contentId IN (SELECT id FROM umbracoNode WHERE path LIKE '%-20%' AND id != -20) | |
| DELETE FROM cmsDocument WHERE nodeId IN (SELECT id FROM umbracoNode WHERE path LIKE '%-20%' AND id != -20) | |
| DELETE FROM cmsContentXML WHERE nodeId IN (SELECT id FROM umbracoNode WHERE path LIKE '%-20%' AND id != -20) | |
| DELETE FROM cmsContent WHERE nodeId IN (SELECT id FROM umbracoNode WHERE path LIKE '%-20%' AND id != -20) | |
| DELETE FROM cmsPropertyData WHERE contentNodeId IN (SELECT id FROM umbracoNode WHERE path LIKE '%-20%' AND id != -20) |
| // Router: a router that can be combined with jquery.pjax.js [1] | |
| // | |
| // [1] https://github.com/defunkt/jquery-pjax | |
| // | |
| // This file is in the public domain. | |
| // | |
| // | |
| // var router = new Router(); | |
| // $(document).on('pjax:end', function () { router.dispatch(location); }); | |
| // $(function () { router.dispatch(location); }); |
This gist has been expanded to a full project repository.
Please go to: https://github.com/leekelleher/umbraco-package-ideas
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <title>My Site's Title</title> | |
| <script src="/Scripts/jquery-1.6.4.min.js" type="text/javascript"></script> | |
| <script src="/Scripts/jquery.signalR-0.5.2.min.js" type="text/javascript"></script> | |
| <script src="/SignalR/hubs" type="text/javascript"></script> |
| using System; | |
| using System.Linq; | |
| using StructureMap; | |
| namespace ConsoleApplication1 | |
| { | |
| /// <summary> | |
| /// See http://stackoverflow.com/questions/6777671/setting-up-structure-map-in-a-c-sharp-console-application | |
| /// Updated for SM 4: http://ardalis.com/using-structuremap-4-in-a-console-app | |
| /// </summary> |
Enabling a scripting mechanism for Umbraco, using a console (command line interface) to execute the scripts/queries.
So far, the examples are using C#, however a suitable scripting language should be used. Currently JavaScript is the favourite, followed by Lua and Python.
| <#@ template debug="true" hostspecific="true" language="C#" #> | |
| <#@ output extension=".d.ts" #> | |
| <# /* Update this line to match your version of SignalR */ #> | |
| <#@ assembly name="$(SolutionDir)\packages\Microsoft.AspNet.SignalR.Core.2.2.0\lib\net45\Microsoft.AspNet.SignalR.Core.dll" #> | |
| <# /* Load the current project's DLL to make sure the DefaultHubManager can find things */ #> | |
| <#@ assembly name="$(TargetPath)" #> | |
| <#@ assembly name="System.Core" #> | |
| <#@ assembly name="System.Web" #> | |
| <#@ assembly name="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" #> | |
| <#@ assembly name="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" #> |
| using Umbraco.Core; | |
| using Umbraco.Core.Services; | |
| using Umbraco.Web.Mvc; | |
| using Umbraco.Web.Routing; | |
| namespace Our.Umbraco | |
| { | |
| public class MyApplication : ApplicationEventHandler | |
| { | |
| protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) |
| let lToS (l:char list) = System.String.Concat(Array.ofList(l)) | |
| let sumString = | |
| let parse (l:string) = | |
| let guessDelimeter (l:string) = | |
| match Seq.toList l with | |
| | '/'::'/'::c::'\n'::_ -> c | |
| | _ -> Seq.find (fun i -> i = ',' || i = '\n') l | |
| let valuePart = (fun (s:string) -> | |
| match Seq.toList s with |