Skip to content

Instantly share code, notes, and snippets.

Nikolay Rozhkov nirname

Block or report user

Report or block nirname

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nirname
nirname / ie_iterator.js
Created Jan 18, 2013
Iterating over Arrays for IE using JQuery
View ie_iterator.js
if (typeof Array.prototype.indexOf == "undefined") {
Array.prototype.indexOf = function(value) {
for (var i = 0; i < this.length; i++) {
if (this[i] == value) {
return i;
}
}
return -1;
}
}
@nirname
nirname / inject.coffee
Last active Dec 11, 2015
Inject method in CoffeSrcipt using JQuery
View inject.coffee
# inject function
inject = (collection, object, handler)->
$.each collection, (index, value)->
object = handler(object, value)
true
object
# the same as a method
inject_method = (object, handler)->
inject(this, object, handler)
You can’t perform that action at this time.