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
// Call method. | |
var method = (success ? 'start' : 'stop'); | |
obj[method](); | |
// Concatenation. | |
['first', 'name'].join(' '); // = 'first name'; | |
['milk', 'coffee', 'suger'].join(', '); // = 'milk, coffee, suger' | |
// Value by default. | |
var name = myName || 'No name'; // Returns 'No name' when myName is null or undefined |
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
/** | |
* Implementation of template preprocess for the view. | |
*/ | |
function template_preprocess_views_bootstrap_accordion_plugin_style(&$vars) { | |
$view = &$vars['view']; | |
$title_field = $vars['options']['title_field']; | |
// Get titles. | |
if (isset($view->field[$title_field])) { | |
foreach ($vars['view']->result as $key => $field) { |
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
# Customize to your needs... | |
GEMS=$(brew --prefix ruby)/bin | |
LOCALS=/usr/local/bin:/usr/local/sbin | |
SYSTEM=/usr/bin:/bin:/usr/sbin:/sbin | |
export PATH=$LOCALS:$GEMS:$PATH |
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
// Search. | |
var found = $filter('filter')($scope.suggestions, {uid: suggestion.uid}, true); | |
var found = $filter('getById')($scope.suggestions, fish_id); | |
// Find and delete. | |
$scope.suggestions.splice( $scope.suggestions.indexOf(suggestion), 1 ); | |
// Get half of items. | |
$scope.suggestions.slice(0, $scope.suggestions.length / 2); |
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
[{"id":1,"name":"AB InBev"},{"id":11,"name":"Adventure"},{"id":21,"name":"Barnet"},{"id":31,"name":"Beavertown"},{"id":41,"name":"Belleville"},{"id":51,"name":"Botanist"},{"id":61,"name":"Brew by Numbers"},{"id":71,"name":"Brew Wharf"},{"id":81,"name":"Brockley"},{"id":91,"name":"Brodie's"},{"id":101,"name":"Brüpond"},{"id":111,"name":"By the Horns"},{"id":121,"name":"Camden Town"},{"id":131,"name":"Clarence \u0026 Fredericks"},{"id":141,"name":"Crate"},{"id":151,"name":"The Cronx"},{"id":161,"name":"Earl's"},{"id":171,"name":"East London"},{"id":181,"name":"Ellenberg's"},{"id":191,"name":"Five Points"},{"id":201,"name":"Fuller's"},{"id":211,"name":"Hackney"},{"id":221,"name":"Ha'penny"},{"id":231,"name":"A Head in a Hat/Florence"},{"id":241,"name":"Hoppy Collie"},{"id":251,"name":"Howling Hops"},{"id":261,"name":"The Kernel"},{"id":271,"name":"The Lamb"},{"id":281,"name":"Late Knights"},{"id":291,"name":"Little Brew"},{"id":301,"name":"London"},{"id":311,"name":"London Fields"},{"id":321,"name":"Meantime"},{ |
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 asynkFunction(){ | |
return $timeout(function meAsynk(){ | |
throw new Error('error in meAsynk'); | |
}, 1); | |
} | |
asynkFunction().catch(function (err) { | |
errorHandler(err); | |
}); |
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
npm install -g cordova | |
npm install -g ionic | |
ionic start myApp | |
cd myApp | |
ionic platform ios | |
ionic emulate ios | |
ionic run ios |
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 | |
$obj = new ArrayObject(); | |
$obj['hello'] = NULL; | |
print 'ArrayObject<br >'; | |
var_dump(empty($obj['hello'])); // TRUE | |
var_dump(isset($obj['hello'])); // FALSE | |
var_dump(array_key_exists('hello', $obj)); // TRUE | |
class Test1 extends ArrayObject { |
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 | |
function example_form($form, &$form_state) { | |
$form['foo'] = array( | |
'#type' => 'select', | |
'#title' => t('Foo'), | |
'#options' => array('one', 'two', 'three'), | |
'#ajax' => array( | |
'callback' => 'example_foo_callback', | |
'wrapper' => 'bar-sections' |
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
<ul class="nav nav-tabs"> | |
<li ng-repeat="team in teams" ng-class="{active: $index == 0}"> | |
<a href="#" data-toggle="tab">{{team.name}}</a> | |
</li> | |
</ul> |