Skip to content

Instantly share code, notes, and snippets.

View alexhidalgo's full-sized avatar
🌴
On vacation

Alex Hidalgo alexhidalgo

🌴
On vacation
View GitHub Profile
<Response>
<Say voice="alice">Hello!</Say>
</Response>
@alexhidalgo
alexhidalgo / Backbone Model
Last active August 29, 2015 14:18
Backbone
var myToDoModel = Backbone.Model.extend({
urlRoot: 'http://tiny-pizza-server.herokuapp.com/collections/alex-todo-items',
defaults: {
todo: null,
completed: true
},
idAttribute: '_id'
});
I am very proud of the Backbone model I created above for two reasons. Firstly, this model
.controller('JournalCtrl', function($scope, $http, $interval) {
$interval(function() {
$http.get('http://tiny-pizza-server.herokuapp.com/collections/alex-hackathon-journal1')
.success(function(response){
$scope.messages = [];
for( var i = 0; i < response.length; i++ ) {
if(response[i].plantType && response[i].plantQuantity && response[i].plantNotes) {
$scope.messages.push(response[i]);
@alexhidalgo
alexhidalgo / Date function
Created February 28, 2015 23:51
Date only timeStamp()
function timeStamp() {
// Create a date object with the current time
var now = new Date();
// Create an array with the current month, and day
var date = [ now.getMonth() + 1, now.getDate(), now.getFullYear() ];
// Return the formatted string
return date.join("/") + suffix;