This file contains 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
// overriding sync to use local storage when possible | |
sync : function(method, model, options){ | |
var key, now, timestamp, refresh; | |
if(method === 'read' && this.constants.isStoredInLocalStorage) { | |
// only override sync if it is a fetch('read') request | |
key = this.getKey(); | |
if(key) { | |
now = new Date().getTime(); | |
timestamp = $storage.get(key + ":timestamp"); | |
refresh = options.forceRefresh; |
This file contains 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
try { | |
module.$localStorage[key] = serializer(value); | |
} catch(e) { | |
if(e.name === 'QUOTA_EXCEEDED_ERR') { | |
// reset to make space | |
module.reset(); | |
module.$localStorage[key] = serializer(value); | |
} else { | |
module.localStorageAvailable = false; | |
$log.error("Local storage write failure - " + e); |
This file contains 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
<app-id>:user:<user-id>:<key-name> |
This file contains 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
$add-experience-icon-data: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAgCAYAAAB6kdqOAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAUtJREFUeNpiZEACe/YeEABS64HYgYE+4AAQB7o4O3yACTChKaCnYxigdq1HFmDBooBBSVGBQVFRnqYuuX//IcO9+w8Y0AOACZtiWjsGBGRlpbGKMw5AusGbnpgGiWPg6YmFnumGmPTERM90Q0x6YiFGA9T1DNJSUgzs7GxUdxALCwvxDlqxag3DmzdvwWyQY+JiomniKLzZHgaePnsGdwwI/Pz5Cxjf92kafUykavj0+cvAOejzp890T+B4HaShoc4gLS0F54PSjr6e7sBGGShnwYCSoiLNQwhrLgMl3ouXLgPxJTAbBq7fuAksAu4zaKirM5iZmtAkt2ENoW07djKcOn0GxTHojl20ZCn9ouzp02cENWJzLM2iLCcrfcCqESaGQQawhtCUaTNJNohaoTroQmjUQaO5bNDkMnIAtpgYTUOjaWjYpSGAAAMAOdVqvldCIWIAAAAASUVORK5CYII="; | |
@mixin add-experience-icon { | |
@include base-image ( | |
$add-experience-icon-data, | |
36px, | |
32px | |
) | |
}; |
This file contains 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
overflow: scroll; | |
-webkit-overflow-scrolling: touch; |
This file contains 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 div = document.getElementById("container"); | |
var docFrag = document.createDocumentFragment(); | |
for ( var i = 0; i < elems.length; i++ ) { | |
docFrag.appendChild( elems[i] ); | |
} | |
div.appendChild(docFrag); |
This file contains 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
@mixin accelerate { | |
-webkit-transform:translate3d(0,0,0); | |
} |
This file contains 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
.spinner { | |
-webkit-animation-duration: 1s; | |
-webkit-animation-iteration-count: infinite; | |
-webkit-animation-timing-function: linear; | |
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABs0lEQVQ4y42TPS8EURSG18ey4nuFNXPu+bizFMRGQmI7ChEEBYWCgoKSKFVCQhRaLVrR+wsSSn6AX6Hmnd0hk7UrbvIkd+bO+5733Ds3k/ljFNXuwUPmvyMSZXAHwsTgOSaec8G1iBN25LINDbxIbPABbhODJ/ASz8Ux5FKygH4bRCwBKCQp9sAnmIH4EbwOD1FWRCaFNF8xC1xW0kZF0cui6hvYSkyewCnES2CDyPWi+ki8piRDRjptJD6VQAniK/AO7vE8CLq+15VdsxakBcIxIysraRSF1FZvE6eR5miE7VeffsA3aaAhk+usFR2A84QzYx1vtMk4hV5Un0goCaEtiA7BxTeedbKhAUl32gCM1qSRCKzhOFtrxZqPmtD/qDrpq3f+eQh3wQ049sJdyvqzDxxyqw37NnNWBsug5Ely6co74BrMVQxZ98G8iYTAmeOSMS/EaxAzWDCnE+kE/aCvKpYpiC8gZM+8jPerxjIAg20QVUxCa7dAc3Va0R6IT8BG1YxX0M5qRcQ8AzZRoKPhXUCsHlRex4/TnaRZhMFatarkzEkZm9jx79uJ+LMxf33zBSwYVsQayZ4lAAAAAElFTkSuQmCC) 0 50% no-repeat; | |
background-size: 16px; | |
.... | |
} |
This file contains 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
<!--loaded--> | |
<div data-src="" | |
style="background-image: url(http://www.blogcdn.com/www.joystiq.com/media/2012/07/assassinscreedthefall530px.jpg);"> | |
</div> | |
<!--unloaded--> | |
<div data-src="http://www.blogcdn.com/www.joystiq.com/media/2012/07/assassinscreedthefall530px.jpg" | |
style="background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAABJJREFUeF4FwIEIAAAAAKD9qY8AAgABdDtSRwAAAABJRU5ErkJggg==);"> | |
</div> |
This file contains 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
Lix.getBucket('mobile.abtest1', 'memberId:23', function(err, bucket) { | |
if(bucket === 'A') { | |
// do A | |
AsyncCallForA(req, handleAFn) | |
} else if(bucket === 'B') { | |
// do B | |
AsyncCallForB(req, handleBFn) | |
} | |
} |
OlderNewer