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.Controller.extend({ | |
hideHomeButtonRoutes: ['index', 'login'], | |
isHomeButtonVisible: Ember.computed('currentRouteName', function(){ | |
return this.get('hideHomeButtonRoutes').indexOf(this.get('currentRouteName')) === -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.Component.extend({ | |
tagName: "section", | |
page: 1, | |
paginateBy: 10, | |
paginatedItems: Ember.computed('amenities', 'page', function(){ | |
var i = (parseInt(this.get('page')) - 1) * parseInt(this.get('paginateBy')); | |
var j = i + parseInt(this.get('paginateBy')); | |
return this.get('items').slice(i, j); |
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.Component.extend({ | |
// {Property} List of details | |
studentDetails: null, | |
// {Property} Filtered student | |
filteredStudent: null, | |
// {Property} List of students |
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.Component.extend({ | |
studentDetails: null, | |
// {Property} List of students | |
students: Ember.computed('studentDetails.@each.student', function() { | |
let studentDetails = this.get('studentDetails') || []; | |
return studentDetails.getEach('student').uniq(); | |
}), |
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'; | |
const { computed: { alias }, observer } = Ember | |
export default Ember.Component.extend({ | |
routing: Ember.inject.service('-routing'), | |
params: alias('routing.router.currentState.routerJsState.fullQueryParams') | |
}) |
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
<div style="width: 100%"> | |
<div style="width: 33%; float:left"> | |
<h3>CommentList.js</h3> | |
<pre><code>class CommentList extends React.Component { | |
constructor() { | |
super(); | |
this.state = { comments: [] } | |
} | |
componentDidMount() { | |
$.ajax({ |
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
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |
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
<?php | |
/** | |
* Convert a multi-dimensional array into a single-dimensional array. | |
* @author Sean Cannon, LitmusBox.com | seanc@litmusbox.com | |
* @param array $array The multi-dimensional array. | |
* @return array | |
*/ | |
function array_flatten($array) { | |
if (!is_array($array)) { |
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
<?php | |
/** | |
* array_merge_recursive_numeric function. Merges N arrays into one array AND sums the values of identical keys. | |
* WARNING: If keys have values of different types, the latter values replace the previous ones. | |
* | |
* Example: | |
* | |
* $a = array( "A" => "bob", "sum" => 10, "C" => array("x","y","z" => 50) ); | |
* $b = array( "A" => "max", "sum" => 12, "C" => array("x","y","z" => 45) ); | |
* $c = array( "A" => "tom", "sum" => 8, "C" => array("x","y","z" => 50, "w" => 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
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # |
NewerOlder