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
[ | |
{ | |
"name": "Give someone a compliment.", | |
"duration": "5", | |
"frequency": "Daily", | |
"image": "pexels-photo-134074.jpeg" | |
}, | |
{ | |
"name": "Do a quick high intensity workout.", | |
"duration": "5", |
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
console.log "card: " + cardId + " choice: " + choiceId | |
cardQuery = new Parse.Query 'Card' | |
cardQuery.equalTo 'objectId', cardId | |
cardQuery.first | |
success: (card) => | |
card.addUnique 'hasPlayed', user.id | |
card.save() |
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
# UPDATE Pref table to include current user in peggedBy array | |
console.log "peggee: #{peggeeId} card: #{cardId} choice: #{choiceId} " | |
card = new Parse.Object 'Card' | |
card.set 'id', cardId | |
peggee = new Parse.Object 'User' | |
peggee.set 'id', peggeeId | |
prefQuery = new Parse.Query 'Pref' | |
prefQuery.equalTo 'card', card | |
prefQuery.equalTo 'user', peggee | |
prefQuery.first |
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
@state.halt() | |
@currentSide ?= 0 | |
if side is 0 or side is 1 | |
@currentSide = side | |
else | |
@currentSide = if @currentSide is 1 then 0 else 1 |
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
# TODO: make cards scroll on z axis | |
#@cards.outputFrom (offset) -> | |
# Transform.multiply( | |
# Transform.translate offset/100, offset/100, 50 | |
# Transform.rotateY(1) | |
# ) |
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
fetchCards: () -> | |
# Gets 10 random cards from Card class | |
Choice = Parse.Object.extend 'Choice' | |
Card = Parse.Object.extend 'Card' | |
cardQuery = new Parse.Query Card | |
cardQuery.limit 10 | |
cardQuery.find | |
success: (cards) => | |
choiceQuery = new Parse.Query Choice | |
done = 0 |
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 params = "name=augman&password=hello"; | |
$.post(this.host + "/db/_session", params, function (res) { | |
if (JSON.parse(res).ok) { | |
cb(null, {message: "register success", details: res}); | |
} else { | |
cb({message: "register failure", details: res}, null); | |
} | |
}); |
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 creds = { "user": $("#username").val(), "email": $("#email").val(), "pass": $("#reg-password").val() }; | |
var user; | |
var appname = Gratzi.Config.appName; | |
Gratzi.register(creds, function (err, res) { | |
if (res) { | |
console.log(res); | |
user = res.details; |
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 creds = { "user": $("#login-email").val(), "pass": $("#signin-password").val() }; | |
var star; | |
var appname = Gratzi.Config.appName; | |
Gratzi.login(creds, function (err, res) { | |
if (res) { | |
console.log(res); | |
star = res.details.star; | |
Cosmos.login(creds, star, appname, function (err, res) { |
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 id="loginRegister"> | |
<div id="login"> | |
<h1>Login</h1> | |
<input type="text" value="" name="email" class="input-block-level" id="login-email" | |
placeholder="email" required> | |
<input type="password" value="" name="password" class="input-block-level" id="signin-password" | |
placeholder="password" required> |
NewerOlder