Skip to content

Instantly share code, notes, and snippets.

View shadow-fox's full-sized avatar

Pranaya Behera shadow-fox

  • Bangalore,India
View GitHub Profile
export default Ember.Route.extend({
authRedirectable: true,
model: function() {
return Ember.RSVP.hash({
user: this.store.find('user', this.auth.get('userId')),
feeds: this.store.find('feed', this.auth.get('userId'))
});
},
@shadow-fox
shadow-fox / error.log
Last active August 29, 2015 13:57
Array error
Uncaught Error: Assertion Failed: The value that #each loops over must be an Array. You passed <(subclass of DS.Model):ember541:10>
@shadow-fox
shadow-fox / team.json
Created March 6, 2014 14:16
Model relationship
{
"team": {
"id": "1",
"group_id": "1",
"name": "FC's FC",
"url_name": "fcs-fc",
"sport": "Football",
"gender": "Ma",
"bio": "Clubs",
"ground": "Indiranagar",
@shadow-fox
shadow-fox / result.json
Created March 5, 2014 13:20
Ember-data expect data as what format ?
{
"team":{
"id":"1",
"group_id":"1",
"name":"Pranaya's Trial Team",
"url_name":"team-pranaya",
"added_by":"10",
"user":[
"10"
],
@shadow-fox
shadow-fox / team.js
Created March 4, 2014 18:45
Ember Models
var Team = DS.Model.extend({
primaryKey: 'url_name',
name : DS.attr('string'),
url_name: DS.attr('string'),
sport : DS.attr('string'),
gender : DS.attr('string'),
bio : DS.attr('string'),
ground : DS.attr('string'),
user : DS.belongsTo('user'),
status : DS.attr('number'),
array (size=2)
0 =>
object(Application\Model\Mapper\User)[374]
public 'id' => string '10' (length=2)
public 'username' => string 'pranaya-beher' (length=13)
public 'email' => string 'pranaya.behera@outlook.com' (length=26)
public 'first_name' => string 'Pranaya' (length=7)
public 'last_name' => string 'Beher' (length=5)
public 'secondary_email' => null
public 'mobile' => string '124578' (length=6)
@shadow-fox
shadow-fox / original.json
Last active August 29, 2015 13:56
How to convert this to the later one ?
{
"user": [
{
"id": "10",
"username": "pranaya-beher",
"email": "pranaya.behera@outlook.com",
"first_name": "Pranaya",
"last_name": "Beher",
"secondary_email": null,
"mobile": "124578",
@shadow-fox
shadow-fox / pastie.txt
Created March 3, 2014 10:06
cors issue
http://pastie.org/8832270
http://pastie.org/8832170
http://pastie.org/8832113
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
@shadow-fox
shadow-fox / covert.php
Last active August 29, 2015 13:56
renaming php object.
$userDetailsObject->firstName = $userDetailsObject->first_name;
$userDetailsObject->lastName = $userDetailsObject->last_name;
$userDetailsObject->backupEmail = $userDetailsObject->secondary_email;
$userDetailsObject->backupMobile = $userDetailsObject->secondary_mobile;
$userDetailsObject->facebook = $userDetailsObject->facebook_id;
$userDetailsObject->google = $userDetailsObject->google_id;
$userDetailsObject->linkedin = $userDetailsObject->linkedin_id;
$userDetailsObject->cityLatLong = $userDetailsObject->city_lat_long;
$userDetailsObject->refferedBy = $userDetailsObject->ref_by;
$userDetailsObject->refferalLink = $userDetailsObject->ref_link;