Skip to content

Instantly share code, notes, and snippets.

View mlynch's full-sized avatar
🍂
Building something new

Max Lynch mlynch

🍂
Building something new
View GitHub Profile
@mlynch
mlynch / landing2conv.js
Created October 14, 2011 17:14
MongoDB landing page conversion
/*
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
@mlynch
mlynch / app1.html
Created December 28, 2011 18:40
jQM Tutorial - HTML Page
<!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">
@mlynch
mlynch / app.html
Created March 19, 2012 03:53
Simple linked pages
<!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"
/>
@mlynch
mlynch / pages.html
Created March 19, 2012 04:14
Simple page
<div data-role="page" id="page1">
<div data-role="header">
<h3>
Page 1
</h3>
</div>
<div data-role="content">
<!-- components go here -->
</div>
</div>
@mlynch
mlynch / button.html
Created March 19, 2012 04:16
Simple button
<div data-role="content">
<a data-role="button" href="#page2">
Go to Page 2
</a>
</div>
@mlynch
mlynch / page2.html
Created March 19, 2012 04:18
Page 2
<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">
@mlynch
mlynch / p2.html
Created March 19, 2012 23:42
page2
<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">
@mlynch
mlynch / models.js
Created May 11, 2012 16:28
Backbone Model Definitions
var UserApp = Backbone.Model.extend({
urlRoot: '/api/v1/user/app'
});
@mlynch
mlynch / app.js
Created May 11, 2012 16:42
Backbone Model Instance
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');
}
@mlynch
mlynch / app.js
Created May 11, 2012 16:48
Backbone - modify model
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');
}
});