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
/* | |
A MongoDB query script. Example output: | |
760 landings | |
69 signups | |
Conversion rate: 9.078947368421053% | |
Campaign conversions: | |
organic: 8.042% - 53/659 | |
betabuild1: 0% - 0/6 | |
betanocodingbuilder: 37.500% - 6/16 | |
betaonlydrag: 50.000% - 2/4 |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1" /> | |
<title>My App</title> | |
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" /> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"> | |
</script> | |
<script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title> | |
</title> | |
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" | |
/> |
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
<div data-role="page" id="page1"> | |
<div data-role="header"> | |
<h3> | |
Page 1 | |
</h3> | |
</div> | |
<div data-role="content"> | |
<!-- components go here --> | |
</div> | |
</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
<div data-role="page" id="page2"> | |
<div data-role="header"> | |
<h3> | |
Page 2 | |
</h3> | |
<a data-role="button" data-direction="reverse" data-rel="back" href="#page2" data-icon="arrow-l" data-iconpos="left"> | |
Back | |
</a> | |
</div> | |
<div data-role="content"> |
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
<div data-role="page" id="page2"> | |
<div data-role="header"> | |
<h3> | |
Page 2 | |
</h3> | |
<a data-role="button" data-direction="reverse" data-rel="back" href="#page2" data-icon="arrow-l" data-iconpos="left"> | |
Back | |
</a> | |
</div> | |
<div data-role="content"> |
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 UserApp = Backbone.Model.extend({ | |
urlRoot: '/api/v1/user/app' | |
}); |
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 a = new UserApp(); | |
a.id = id; | |
a.fetch({ | |
success: function(r) { | |
var name = r.get('name'); | |
console.log('Loaded app:', name); | |
}, | |
error: function(r) { | |
console.log('Unable to load app'); | |
} |
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 app = new UserApp(); | |
app.id = id; | |
app.save({'name': name}, { | |
success: function() { | |
console.log('Changed name of app'); | |
}, | |
error: function() { | |
console.log('Unable to change name of app'); | |
} | |
}); |
OlderNewer