Skip to content

Instantly share code, notes, and snippets.

View samdelagarza's full-sized avatar

Sam De La Garza samdelagarza

View GitHub Profile
Backbone.Collection = function (models, options) {
options || (options = {});
if (options.comparator) {
this.comparator = options.comparator;
delete options.comparator;
}
this._boundOnModelEvent = _.bind(this._onModelEvent, this);
this._reset();
if (models) this.refresh(models, { silent: true });
_contracts = new _widgetCollections.Contracts();
_contractDropDown = new _widgetViews.contractDropDown({
collection: _contracts
});
And in a seperate file this is the collection definition:
removeContractProfileFromGrid = function (event) {
var
contractProfileId = $(event.currentTarget).parent().data('dataKey'),
contractProfileRecord = _contractProfileGridRecords.get(contractProfileId);
_contractProfileGridRecords.remove(contractProfileRecord);
},
removeFacilitySpecificItemsFromGrid = function (facilityId) {
var
bindingStorageElement = $('#ProductNames'),
productCollection = $(bindingStorageElement).data('products'),
newSelectionsParent = {},
newSelections = [];
if (productCollection !== undefined) {
$.each(productCollection.Items, function (key, item) {
if (item.FacilityId !== facilityId.toString()) {
_.pluck(_productCollection.Items, "Id"), function (Id) {
return Id === product.Id;
})
_productCollection = {
CriteriaType: "Products",
Items: {
Facility: null,
FacilityId: null,
Name: "",
require 'rubygems'
require 'albacore'
task :default => :build
msbuild :build do |msb|
msb.solution = "source/ContractManager.sln"
msb.targets :clean, :build
msb.properties :configuration => :release
end
criteria.formbuilder = (function () {
var reloadCriteria = function () {
console.log('hi');
};
return {
reloadCriteria: reloadCriteria,
};
// 1: how could you rewrite the following to make it shorter?
if (foo) {
bar.doSomething(el);
} else {
bar.doSomethingElse(el);
}
Use.Transaction(GetSessionFactory(facilityId), session => {
facilityName = session
.Linq<FacilityHierarchy>()
.Where(x => x.FACID == facilityId)
.Select(x => x.DOM_NAME)
.SingleOrDefault();
});
<body>
<div id="Container">
<div id="Header">
<div id="TopNav">
<div class="wrapper">
Download at: [codeplex link here] <span><a href="#">Overview</a></span> <span><a
href="#">Screencasts</a></span> <span><a href="#">Api Documentation</a></span>
</div>
</div>
<div id="MastHead">