Skip to content

Instantly share code, notes, and snippets.

View aissatech's full-sized avatar

Camelia Boban aissatech

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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>');
}
});
var appointmentView = new AppointmentView({model: appointment});
@katowulf
katowulf / 1_using_queries.js
Last active April 24, 2023 07:14
Methods to search for user accounts by email address in Firebase
/***************************************************
* Simple and elegant, no code complexity
* Disadvantages: Requires warming all data into server memory (could take a long time for MBs of data or millions of records)
* (This disadvantage should go away as we add optimizations to the core product)
***************************************************/
var fb = firebase.database.ref();
/**
* @param {string} emailAddress
<section>
<h2>Calculate your Caffeine Level</h2>
<div class="menu">
<h3>Coffee</h3>
<p id="newCoffee"><a href="#">Add Coffee</a></p>
<ul class="drink">
<li><a href="#" data-level="1">American</a><span class="tooltip">Level 1 Caffeine</span></li>
<li><a href="#" data-level="2">Colombian</a><span class="tooltip">Level 2 Caffeine</span></li>
<li><a href="#" data-level="3">Brazilian</a><span class="tooltip">Level 3 Caffeine</span></li>