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
v: 9.1.4 | |
if have table users: | |
id is_admin | |
-- -------- | |
1 t | |
2 f | |
3 |
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
Say you have a model set with many items. In Ember: | |
set.items[0] #incorrect | |
=> | |
set.get("items").objectAt(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
Error: Failed to load unit/state_managers_spec.js.coffee | |
- could be one of the require statements file name incorrect |
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
Uncaught Error: assertion failed: Cannot call get with 'id' on an undefined object. (em1.0.rc1) | |
- make sure link is properly defined | |
e.g. {{#linkTo item}} will cause problems: should be {{#linkTo item item}} | |
Uncaught TypeError: Object <(generated set controller):ember417> has no method 'addArrayObserver' (em1.0.rc1) | |
- can happen when controller is Em.ArrayController but should be Em.ObjectController (perhaps no array defined) |
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
Ref: | |
http://docs.mongodb.org/manual/reference/mongodump/ | |
mongorestore --collection people --db accounts dump/accounts/ | |
Say you want to transfer your local mongo dbs to another machine. One way using dump and restore is: | |
1. run mongodump on old machine | |
- this will put all your mongo dbs in a directory called dump in the current dir | |
- for instance if you have one db called mydb, will have a dir dumb/mydb with your data |
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
c. Devise 2.1.2 | |
ref: https://github.com/plataformatec/devise/issues/1561 | |
E.g. you may want to send back json instead of html on login, etc. | |
Steps: | |
1. Override the controller (put in the controllers dir) | |
class SessionsController < Devise::SessionsController |
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
c. 0.5.2 | |
Make sure not doing .to_json | |
This will not work!!! | |
render :json=>songs.to_json | |
This works: | |
render :json=>songs |
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
c. jqm 1.2 | |
$(document).on "tap", someSelector, (event) -> | |
log "evX", event.clientX | |
log "evY", event.clientY | |
seems to work with tap, vmouse, etc. |
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
c. JQuery 1.8 | |
for some reason this only works about half the time. rather than waste time on mindless and costly debugging instead always use: | |
$(someField).attr "value", val |
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
c. UMongo 1.2.1 | |
In the server text field, change 'localhost' to '127.0.0.1' and it should work |