Conceptually similar to: http://guides.rubyonrails.org/association_basics.html#polymorphic-associations
Example models: Picture, Author, Reader.
The usual options apply, for example: as: 'photos' to specify a different relation name/accessor.
| module.exports = function(app) { | |
| var User = app.models.User; | |
| // TODO: (1) find an example of how to add new "properties" to the built-in User mode via boot script | |
| // (2) This is how you can add a "relationship" to the built-in User model via boot script | |
| var SomeOtherModel = app.models.SomeOtherModel; | |
| User.hasMany(SomeOtherModel, {as: 'someOtherModels', foreignKey: 'someOtherModelId'}); | |
| // (3) This is how you can add "remote methods" to the built-in User model via boot script |
| /** | |
| * the HTML5 autofocus property can be finicky when it comes to dynamically loaded | |
| * templates and such with AngularJS. Use this simple directive to | |
| * tame this beast once and for all. | |
| * | |
| * Usage: | |
| * <input type="text" autofocus> | |
| * | |
| * License: MIT | |
| */ |
| @ECHO OFF | |
| IF "%1"=="" GOTO MissingFileNameError | |
| IF EXIST "%1" (GOTO ContinueProcessing) ELSE (GOTO FileDoesntExist) | |
| :ContinueProcessing | |
| set FileNameToProcess=%1 | |
| set FileNameForDx=%~n1.dex | |
| IF "%~x1"==".dex" GOTO ProcessWithPowerShell | |
| REM preprocess Jar with dx |
| /// | |
| /// A very simple Loggly client for Parse.com cloudcode. | |
| /// Usage: | |
| /// logger = require('cloud/libs/logger'); | |
| /// logger.setToken('your-loggly-token', 'appname'); // Appname is optional. | |
| /// | |
| /// logger.log("A String to Log", {'key': 'Extra fields to add to loggly entry'}); | |
| /// /// The logger will add a few fields replicating the iOS client fields to help filtering and setting up a grid view on Loggly. | |
| /// | |
| /// logger.setConsoleLogging(false); // Stop the logger exhoing to Parse's console. |
Conceptually similar to: http://guides.rubyonrails.org/association_basics.html#polymorphic-associations
Example models: Picture, Author, Reader.
The usual options apply, for example: as: 'photos' to specify a different relation name/accessor.
| /* | |
| * Copyright (C) 2014 The Android Open Source Project | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
| // By Janaka Jayasuriya, @pinkydoe | |
| // Original By Jamie Chapman, @chappers57 | |
| // License: open, do as you wish, just don't blame me if stuff breaks ;-) | |
| package us.peripl.app.util; | |
| import com.parse.ParseFile; | |
| import com.parse.ParseGeoPoint; | |
| import com.parse.ParseObject; |
| #!/bin/sh | |
| # Restartes the parse log if it crashes | |
| # stdbuf flushes the Parse log buffer so they come in real time | |
| until stdbuf -oL /usr/local/bin/parse log -f > info.log; do | |
| echo "Parse log crashed with exit code $?. Respawning.." >&2 | |
| sleep 1 | |
| done | |
| git checkout --orphan temp_master | |
| git rm -rf . | |
| git commit --allow-empty -m 'Make initial root commit' | |
| git rebase --onto temp_master --root master | |
| git branch -D temp_master |