This file contains 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
<select | |
ng-model="selectedOption" | |
ng-options="option.name for option in options"> | |
</select> | |
or | |
<select | |
ng-model="selectedOption" |
This file contains 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
Session session = factory.openSession(); | |
Transaction tx = null; | |
try { | |
tx = session.beginTransaction(); | |
// do some work | |
... | |
tx.commit(); | |
} | |
catch (Exception e) { |
This file contains 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
//to iterate over form controls in $form | |
foreach(element_children($form) as $key) { | |
$form[$key]['#attributes']['class'][] = 'vr-paragraphs'; | |
} |
This file contains 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
// respond to a Bootstrap carousel "slid" event | |
$('#my-carousel').on('slid', '.carousel', function() { | |
// first, since we're outside AngularJS, we need to grab | |
// the AngularJS scope that this element resides in | |
var scope = angular.element(this).scope(); | |
// next, we find the active item in the carousel, and grab | |
// some data-* from it | |
var active = $(this).find('.active'); | |
var description = active.attr('data-description'); |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |