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
$.getScript("http://underscorejs.org/underscore-min.js", function(s) { $.getScript("http://backbonejs.org/backbone-min.js", function() { console.log("done"); }) }) |
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
$._data(document.getElementById(''), 'events') |
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 isHintShown = false; $(document).on('scroll', function(e) { var doc = $(this); if (!isHintShown && (doc.scrollTop() >= Math.round(doc.height() / 2))) { console.log('Middle'); isHintShown = true; } } ); |
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
delay(time) | |
E.g. | |
$('query').fadeIn(5000).delay(5000).fadeOut(5000); |
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
AND ClickedDate BETWEEN '01/03/2012' AND '12/03/2013' | |
-- OR | |
AND DATEADD(DAY, DATEDIFF(DAY, 0, ClickedDate), 0) BETWEEN '01/03/2012' AND '12/03/2013' | |
--OR | |
AND ClickedDate >= '01/03/2012' AND ClickedDate <= '12/03/2013' |
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
System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase |
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 array = new List<int>() {3, 4}; | |
var query = Query.All("SomeArray", BsonArray.Create(array)); | |
collection.Find(query); | |
//The result of Query.All will all documents thats have nested array SomeArray with values 3 and 4. | |
//If you want 3 or 4 use | |
Query.In("SomeArray", BsonArray.Create(array)) |
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
{$and:[{SiteId:ObjectId('516f33ab317fa76d0839b3d3')},{Year:2013,Month:1,Day:{$gte:1,$lte:10}}]} {$and:[{SiteId:ObjectId('516f33ab317fa76d0839b3d3')},{'Year':2013},{$or:[{Month:1,Day:{$gte:30}},{Month:2},{Month:3,Day:{$lte:10}}]}]} {$and:[ {SiteId:ObjectId('516f33ab317fa76d0839b3d3')}, {$or:[ {Year:2011,Month:10,Day:{$gte:30}}, {Year:2011,Month:{$gt:10}}, {Year:{$gt:2011,$lt:2013}}, {Year:2013,Month:{$lt:1}}, {Year:2013,Month:1,Day:{$lte:10}} ]} ]} |
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 PropertyBag : DynamicObject { private object _source; public PropertyBag(object source) { _source = source; } public object GetProperty(string name) { var type = _source.GetType(); var property = type.GetProperty(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); return property.GetValue(_source, null); } public override bool TryGetMember(GetMemberBinder binder, out object result) { result = GetProperty(binder.Name); return true; } public override bool TryGetIndex(GetIndexBinder binder, object[] indexes, out object result) { result = GetProperty((string)indexes[0]); return true; } } |
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
.SetSortOrder(SortBy.Descending("PropertyName")) |