Skip to content

Instantly share code, notes, and snippets.

View Craga89's full-sized avatar

Craig Michael Thompson Craga89

View GitHub Profile
@hyle
hyle / ko.utils.3.1.0.signatures.js
Created March 5, 2014 08:30
KnockoutJS 3.1.0 utils (ko.utils) signatures
ko.utils.addOrRemoveItem = function (array, value, included) { /* .. */ }
ko.utils.anyDomNodeIsAttachedToDocument = function (nodes) { /* .. */ }
ko.utils.arrayFilter = function (array, predicate) { /* .. */ }
ko.utils.arrayFirst = function (array, predicate, predicateOwner) { /* .. */ }
ko.utils.arrayForEach = function (array, action) { /* .. */ }
@Craga89
Craga89 / ios-fixedpos-fix.js
Created November 3, 2010 22:38
Fixes the jQuery.fn.offset() function in iOS to correct for fixed positioning issues (v3.1-4.0, v4.3-4.3.3)
(function() {
var iOS = parseFloat(
('' + (/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent) || [0,''])[1])
.replace('undefined', '3_2').replace('_', '.').replace('_', '')
) || FALSE;
if((iOS > 3.1 && iOS < 4.1) || (iOS >= 4.3 && iOS < 4.33)){
$.fn._oldOffset = $.fn.offset;
$.fn.offset = function() {
var result = $.fn._oldOffset.call(this);