This file contains hidden or 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
function rgb2hex(rgb) { | |
if ( rgb.search("rgb") == -1 ) { | |
return rgb; | |
} | |
else if ( rgb == 'rgba(0, 0, 0, 0)' ) { | |
return 'transparent'; | |
} | |
else { | |
rgb = rgb.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+))?\)$/); | |
function hex(x) { |
This file contains hidden or 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
function randomUUID() { | |
var s = [], itoh = '0123456789ABCDEF'; | |
for (var i = 0; i <36; i++) s[i] = Math.floor(Math.random()*0x10); | |
s[14] = 4; | |
s[19] = (s[19] & 0x3) | 0x8; | |
for (var i = 0; i <36; i++) s[i] = itoh[s[i]]; | |
s[8] = s[13] = s[18] = s[23] = '_'; | |
return s.join(''); | |
This file contains hidden or 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 Appointment = Backbone.Model.extend({}); | |
var appointment = new Appointment(); | |
appointment.set('title', 'My knee hurts'); | |
var AppointmentView = Backbone.View.extend({ | |
render: function(){ | |
$(this.el).html('<li>' + this.model.get('title') + '</li>'); | |
} |
This file contains hidden or 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 Appointment = Backbone.Model.extend({ | |
defaults: function (){ | |
return { | |
title: 'Checkup', | |
date: new Date() | |
} | |
} | |
}); | |
var Appointment = Backbone.Model.extend({urlRoot: '/appointments'}); |
This file contains hidden or 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 AppointmentView = Backbone.View.extend({ | |
tagName: 'li', | |
className: "appointment", | |
}); | |
var AppointmentView = Backbone.View.extend({ | |
render: function(){ | |
this.$el.html('<li>' + this.model.get('title') + '</li>'); | |
} | |
}); |
This file contains hidden or 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 AppointmentView = Backbone.View.extend({ | |
template: _.template('<span><%= title %></span><a href="#">x</a>'), | |
events: {"click a": "cancel"}, | |
cancel: function() { | |
this.model.set({cancelled:true}); | |
}, | |
render: function(){ | |
this.$el.html(this.template(this.model.toJSON())); |
This file contains hidden or 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 AppointmentList = Backbone.Collection.extend({ | |
model: Appointment | |
}); | |
//////////////////////////// | |
var Appointment = Backbone.Model.extend({}); | |
var AppointmentList = Backbone.Collection.extend({ | |
model: Appointment | |
}); |
This file contains hidden or 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
https://github.com/mozilla/mozillians/blob/master/docs/contribute.rst | |
hi | |
10:38 fxa90id hi marti1125 | |
10:38 marti1125 hi giorgos | |
10:41 giorgos hi marti1125 | |
10:42 marti1125 hi... for bug 797790 https://bug797790.bugzilla.mozilla.org/attachment.cgi?id=751581 | |
10:42 firebot Bug https://bugzilla.mozilla.org/show_bug.cgi?id=797790 nor, --, ---, willy, ASSI, Create Your Profile page error message is ambiguous | |
10:44 giorgos marti1125, you have a pull request waiting? | |
10:44 marti1125 no yet.. |
This file contains hidden or 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
Zepto(function($){ | |
var Badge = Backbone.Model.extend({}); | |
var BadgeList = Backbone.Collection.extend({ | |
model: Badge, | |
url: 'https://coderwall.com/marti1125.json?callback=?', | |
parse: function(response) { | |
return response.results; | |
} |
This file contains hidden or 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
<script id="badgeTemplate" type="text/template"> | |
<div class="username"> | |
<% _.each(results, function(res) { %> | |
<li><%= res.username %></li> | |
<% }); %> | |
</div> | |