This file contains hidden or 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
| if (new URLSearchParams(window.location.search).get('portal')) { | |
| // <create start portal> | |
| // Create portal group to contain all portal elements | |
| const startPortalGroup = new THREE.Group(); | |
| startPortalGroup.position.set(SPAWN_POINT_X, SPAWN_POINT_Y, SPAWN_POINT_Z); | |
| startPortalGroup.rotation.x = 0.35; | |
| startPortalGroup.rotation.y = 0; | |
| // Create portal effect |
This file contains hidden or 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
| class DjangoModel(models.Model): | |
| @classmethod | |
| def from_db(cls, db, field_names, values): | |
| instance = super().from_db(db, field_names, values) | |
| instance._state.adding = False | |
| instance._state.db = db | |
| instance._old_values = dict(zip(field_names, values)) | |
| return instance | |
This file contains hidden or 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
| import Cocoa | |
| // This is a Swift Playground to explore some unexpected behavior of '==='. | |
| // | |
| // ICYMI, '===' is the test of _identity_ in Swift; two values a,b are | |
| // references to the same object if a === b | |
| // | |
| // My concern with this is the necessity of testing eqality and identity when | |
| // manipulating complex graphs constructed automatically by code. | |
| // |