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
var nameFormat = /^(\w+__)?([A-Za-z0-9]+(?:_?[A-Za-z0-9]+)+)*(__+.)?$/; | |
var [match, namespace, name, suffix] = nameFormat.exec('NS1__Foo__c'); | |
console.log(namespace); // logs: "NS1__" | |
console.log(name); // logs: "Foo" | |
console.log(suffix); // logs: "__c" |
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
function getAnimals() { | |
var dataSource = this; | |
var ajax = $.ajax({ | |
type: 'GET', | |
url: '/my/remote/endpoint/', | |
data: { | |
limit: dataSource.pager.limit(), | |
startIndex: dataSource.pager.limit() * ( dataSource.pager.page() – 1 ) | |
}, |
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
trigger WellDepthNotification on FX5__Job__c (after update) { | |
for(FX5__Job__c job: Trigger.New) | |
{ | |
if(job.Well_Depth__c > 50) | |
{ | |
Messaging.PushNotification msg = new Messaging.PushNotification(); | |
String userId = job.OwnerId; | |
Set<String> users = new Set<String>(); | |
users.add(userId); | |
Map<String, Object> payload = new Map<String, Object>(); |
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
(function (exports) { | |
"use strict"; | |
function tQuery(selector, context) { | |
var isNew = !(this == window || typeof this === "undefined"); | |
if(!isNew) return new tQuery(selector, context); | |
var target = context || document; | |
var elementsList = target.querySelectorAll(selector); |
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 class ReferralToTreatmentPolicy : Saga<ReferralToTreatmentSagaData>, | |
IAmStartedByMessages<PatientReferredToConsultantLedService>, | |
IHandleMessages<TreatmentStarted>, | |
IHandleMessages<PatientAddedToTransplantList>, | |
IHandleMessages<PatientDeclinedTreatment>, | |
IHandleTimeouts<ReferralToTreatmentPeriodBreach> | |
{ | |
public override void ConfigureHowToFindSaga() | |
{ | |
ConfigureMapping<TreatmentStarted>(s => s.UBRN, m => m.UniqueBookingReferenceNumber); |
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
private void ProvideSelectListForEnums(ModelMetadata modelMetadata, Type modelType) | |
{ | |
if (modelType != null && modelType.IsEnum && string.IsNullOrEmpty(modelMetadata.TemplateHint)) | |
{ | |
modelMetadata.TemplateHint = "SelectList"; | |
var values = Enum.GetValues(modelType).Cast<object>(); | |
var items = values.Select(entry => new SelectListItem { Text = Enum.GetName(modelType, entry), Value = entry.ToString() }); | |
var selectList = new SelectList(items, "Value", "Text", modelMetadata.Model); | |
modelMetadata.AdditionalValues.Add("SelectList", selectList); | |
} |
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 class CustomModelMetadataProvider : DataAnnotationsModelMetadataProvider | |
{ | |
protected override ModelMetadata CreateMetadata(IEnumerable<Attribute> attributes, Type containerType, Func<object> modelAccessor, Type modelType, string propertyName) | |
{ | |
var attributeList = attributes.ToList(); | |
var modelMetadata = base.CreateMetadata(attributeList, containerType, modelAccessor, modelType, propertyName); | |
ProvideTextAreaForBigText(modelMetadata, propertyName); | |
return modelMetadata; |
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
@if (Model == null) { | |
<text>@ViewData.ModelMetadata.NullDisplayText</text> | |
} else if (ViewData.TemplateInfo.TemplateDepth > 1) { | |
<text>@ViewData.ModelMetadata.SimpleDisplayText</text> | |
} else { | |
foreach (var prop in ViewData.ModelMetadata.Properties.Where(pm => pm.ShowForDisplay && !ViewData.TemplateInfo.Visited(pm))) { | |
if (prop.HideSurroundingHtml) { | |
<text>@Html.Editor(prop.PropertyName)</text> | |
} else { | |
<p> |
NewerOlder