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
diff --git a/src/app/algos.coffee b/src/app/algos.coffee | |
index 5a24d1b..fe4d9d1 100644 | |
--- a/src/app/algos.coffee | |
+++ b/src/app/algos.coffee | |
@@ -48,8 +48,9 @@ module.exports.hpModifier = (value, armorDef, helmDef, shieldDef, level, priorit | |
Future use | |
{priority} user-defined priority multiplier | |
### | |
-module.exports.gpModifier = (value, modifier, priority='!') -> | |
- return value * modifier * priorityValue(priority) |
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
diff --git a/src/app/helpers.coffee b/src/app/helpers.coffee | |
index e237c67..740261f 100644 | |
--- a/src/app/helpers.coffee | |
+++ b/src/app/helpers.coffee | |
@@ -102,15 +102,15 @@ viewHelpers = (view) -> | |
view.fn "gold", (num) -> | |
if num | |
- return (num).toFixed(1).split('.')[0] | |
+ Math.floor (num).toFixed(1).split('.')[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
/** | |
* http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript | |
* @returns {string} | |
*/ | |
function guid(){ | |
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {var r = Math.random()*16|0,v=c=='x'?r:r&0x3|0x8;return v.toString(16);}); | |
} |
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
// mongo habitrpg ./node_modules/underscore/underscore.js ./migrations/20130307_normalize_algo_values.js | |
function oldTnl(level) { | |
return (Math.pow(level,2)*10)+(level*10)+80 | |
} | |
function newTnl(level) { | |
var value = 0; | |
if (level >= 100) { | |
value = 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
=== habitrpg Config Vars | |
BASE_URL: http://habitrpg.herokuapp.com | |
FACEBOOK_KEY: ... | |
FACEBOOK_SECRET: ... | |
NODE_DB_URI: ... | |
NODE_ENV: development | |
SESSION_SECRET: ... | |
SMTP_SERVICE: Gmail | |
SMTP_USER: .... | |
STRIPE_API_KEY: ... |
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
curl -X POST -H 'Content-Type:application/json' https://habitrpg.com/v1/users/4f72d380-82ab-11e2-9e96-0800200c9a66/tasks/productivity/up -d '{"apiToken":"4f72d380-82ab-11e2-9e96-0800200c9a66"}' |
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
defaultTasks = [ | |
{type: 'habit', text: '', notes: '', value: 0, up: true, down: false } | |
{type: 'daily', text: '', notes: '', value: 0, completed: false } | |
{type: 'todo', text: '', notes: "", value: -3, completed: false } | |
{type: 'reward', text: '', notes: '', value: 20 } | |
] |
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
model.query('users').withId(model.get('_userId')).subscribe( function(err, user){ | |
if (err) throw err; | |
obj = user.get() | |
}) |
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
{ params: [ uid: '9', taskId: 'productivity', direction: 'up' ], | |
body: { apiToken: 'ae164366-f1ad-4a7d-83ef-b1d1085a96b6' } } | |
TypeError: Cannot read property '1' of undefined | |
at Object.module.exports.getId (/Users/lefnire/Dropbox/Sites/personal/habitrpg/modules/derby/node_modules/racer/lib/transaction.js:24:37) | |
at module.exports.server._commit.res.fail (/Users/lefnire/Dropbox/Sites/personal/habitrpg/modules/derby/node_modules/racer/lib/txns/txns.Model.js:431:43) | |
at Object.store.writeAccess._ref (/Users/lefnire/Dropbox/Sites/personal/habitrpg/website/lefnire/src/server/store.coffee:38:16) | |
at guard (/Users/lefnire/Dropbox/Sites/personal/habitrpg/modules/derby/node_modules/racer/lib/accessControl/accessControl.Store.js:224:14) | |
at next (/Users/lefnire/Dropbox/Sites/personal/habitrpg/modules/derby/node_modules/racer/lib/middleware.js:7:26) | |
at Object.run [as guardWrite] (/Users/lefnire/Dropbox/Sites/personal/habitrpg/modules/derby/node_modules/racer/lib/middleware.js:10:12) | |
at Object.m |
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": "habitrpg", | |
"version": "0.0.0-150", | |
"dependencies": { | |
"derby": { | |
"version": "0.3.13", | |
"dependencies": { | |
"dom-shim": { | |
"version": "0.1.1", | |
"from": "dom-shim@>=0.1.0" |