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
Date.parse(purchase.charge.charge_date).strftime("%B") | |
Date (Year, Month, Day): | |
%Y - Year with century (can be negative, 4 digits at least) | |
-0001, 0000, 1995, 2009, 14292, etc. | |
%C - year / 100 (rounded down such as 20 in 2009) | |
%y - year % 100 (00..99) | |
%m - Month of the year, zero-padded (01..12) |
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
@purchases = current_user.purchases.includes(:charges) | |
#loads the charges for a particular user's purchases into memory, when you | |
#call the below code, the application does not need to go back to memory... | |
current_user.purchases.charges |
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
export default Ember.Component.extend({ | |
//....// | |
newClass: function() { | |
var result; | |
Ember.$.ajax({ | |
url: '/api/surveygizmodata/1', |
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 Ember from 'ember'; | |
export default Ember.Route.extend({ | |
model: function (params) { | |
return Ember.RSVP.hash({ | |
school: this.store.find('school', params.school_id), | |
// data: Ember.$.getJSON('api/surveygizmodata', { school_id: params.school_id } |
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
var a = “first variable”; | |
function myfunction () { | |
var b = “ second variable”; | |
console.log(b); | |
} | |
console.log(a) | |
myfunction(); |
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
var a = “first variable” | |
function myfunction () { | |
///// myfunction execution context | |
var b = “ second variable”; | |
return console.log(b); | |
///// | |
} | |
console.log(a) //=> ‘first variable’ |
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
var a = “first variable”; | |
function myfunction () { | |
var b = “ second variable”; | |
console.log(b); | |
} | |
console.log(a) // => ‘first variable’ | |
myfunction(); //=> ‘second variable’ |
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
function b() { | |
console.log(myvar); | |
} | |
function a( ) { | |
var myvar = 2 | |
b( ); | |
} | |
var myvar = 1; |
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
function a( ) { | |
var myvar = 2 | |
function b() { | |
console.log(myvar); | |
} | |
b( ); | |
} | |
var myVar = 1; |
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
function b() { | |
console.log(myvar); | |
} | |
function a( ) { | |
var myvar = 2 | |
b( ); | |
} | |
var myvar = 1; |