This file contains hidden or 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
//here we declare a special method which will be called | |
// whenever the value has changed from the server | |
$scope.model.onValueChanged = function (newVal, oldVal) { | |
// Model value changed so update UI | |
updateUi() | |
}; | |
var unsubscribe = $scope.$on("formSubmitting", function () { | |
// Write data back to the model.value | |
$scope.model.value = ... |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8" ?> | |
<bzexclusions> | |
... | |
<!-- Exclude dropbox folder --> | |
<excludefname_rule plat="win" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith=":\Users\" contains_1="\Dropbox\" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" /> | |
<!-- Exclude git folders --> | |
<excludefname_rule plat="win" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith=":\Users\" contains_1="\.git\" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" /> |
This file contains hidden or 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.Collections.Generic; | |
using System.Linq; | |
using Examine; | |
using Examine.LuceneEngine; | |
using Helpers; | |
namespace Extensions | |
{ | |
public static class ExamineExtensions | |
{ |
This file contains hidden or 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.Text; | |
/// <summary> | |
/// A class for encrypting and decrypting a string into base64 format which makes it safe for transfer | |
/// between applications. | |
/// | |
/// Reference: | |
/// Based upon the javascript implementation of xxtea by: Chris Veness | |
/// www.movable-type.co.uk/tea-block.html |
This file contains hidden or 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 migs.avg_total_user_cost * (migs.avg_user_impact / 100.0) * (migs.user_seeks + migs.user_scans) AS improvement_measure_pct ,QUOTENAME(db_name(mid.database_id)) AS [database] | |
,QUOTENAME(OBJECT_SCHEMA_NAME(mid.object_id, mid.database_id)) AS [schema] | |
,QUOTENAME(OBJECT_NAME(mid.object_id, mid.database_id)) AS [table] | |
,'CREATE INDEX [mi_' + SUBSTRING(CONVERT(VARCHAR(64), NEWID()), 1, 8) + ']' + ' ON ' + mid.statement + ' (' + ISNULL(mid.equality_columns, '') + CASE | |
WHEN mid.equality_columns IS NOT NULL | |
AND mid.inequality_columns IS NOT NULL | |
THEN ',' | |
ELSE '' | |
END + ISNULL(mid.inequality_columns, '') + ')' + ISNULL(' INCLUDE (' + mid.included_columns + ')', '') AS create_index_statement | |
,migs.*,mid.database_id |
This file contains hidden or 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 PublishedContentExtensions | |
{ | |
public static string GetLanguage(this IPublishedContent content, bool recursive = false) | |
{ | |
try | |
{ | |
var db = ApplicationContext.Current.DatabaseContext.Database; | |
var sql = "SELECT [languageISOCode] FROM [umbracoLanguage] JOIN [umbracoDomains] ON [umbracoDomains].[domainDefaultLanguage] = [umbracoLanguage].[id] WHERE [umbracoDomains].[domainRootStructureID] = @0"; | |
var cultureCode = db.ExecuteScalar<string>(sql, content.Id); |
This file contains hidden or 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 TwitterAccountRawEndpointExtensions | |
{ | |
public static SocialHttpResponse VerifyCredentialsWithParams(this TwitterAccountRawEndpoint endpoint, bool includeEntities = false, bool skipStatus = false, bool includeEmail = false) | |
{ | |
return endpoint.Client.DoHttpGetRequest("https://api.twitter.com/1.1/account/verify_credentials.json", new NameValueCollection | |
{ | |
{ "include_entities", includeEntities ? "true" :"false" }, | |
{ "skip_status", skipStatus ? "true" :"false" }, | |
{ "include_email", includeEmail ? "true" :"false" } | |
}); |
This file contains hidden or 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
// Filter to take a node id and grab it's name instead | |
// Usage: {{ pickerAlias | ncNodeName }} | |
// Cache for node names so we don't make a ton of requests | |
var ncNodeNameCache = { | |
id: "", | |
keys: {} | |
} | |
angular.module("umbraco.filters").filter("ncNodeName", function (editorState, entityResource) { |
This file contains hidden or 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 MyProj.Extensions; | |
using MyProj.Models; | |
using Umbraco.Core; | |
using Umbraco.Core.Persistence; | |
namespace MyProj.Helpers | |
{ |
This file contains hidden or 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
{ | |
"title": "{{title}}", | |
"description": "Hard coded description", | |
"posts": [ | |
{ | |
"#each $..pages[?(@.view == 'BlogPost')]": { | |
"title": "{{title}}", | |
"url" : "{{url}}", | |
"visible" : "{{visible}}" | |
} |