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
@shadow-fox
shadow-fox / result.handlebars
Last active August 29, 2015 13:56
Now fixed.
{{#each team in model.admin }}
<div>
Team Name: {{ team.name }} <br>
Team Sport : {{ team.sport }} <br>
</div>
{{/each}}
User Member In Following Teams:
{{#each team in model.member }}
@shadow-fox
shadow-fox / data store.js
Created February 6, 2014 17:55
data store.
Object {admin: (...), member: (...), __ember1391708982676_meta: Meta}
__ember1391708982676_meta: Meta
admin: Class
__ember1391708982676: "ember595"
__ember1391708982676_meta: Object
_super: undefined
arrangedContent: (...)
content: Array[1]
0: Class
__ember1391708982676: "ember594"
var FollowEvent = DS.Model.extend({
user_id : DS.attr('number'),
sports : DS.attr('string'),
position : DS.attr('string'),
status : DS.attr('number'),
created_at : DS.attr('string'),
modified_at : DS.attr('string'),
success : DS.attr('number'),
fail : DS.attr('number'),
user: DS.hasMany('user')
@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;
<?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 / pastie.txt
Created March 3, 2014 10:06
cors issue
http://pastie.org/8832270
http://pastie.org/8832170
http://pastie.org/8832113
@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",
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 / 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'),
@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"
],