Skip to content

Instantly share code, notes, and snippets.

View lrkwz's full-sized avatar

Luca Orlandi lrkwz

View GitHub Profile
@geraldhumphries
geraldhumphries / entity-dialog.controller.js
Created December 19, 2015 18:26
JHipster autocomplete combobox
$scope.loadOtherEntities = function(searchQuery) {
if (searchQuery){
OtherEntitySearch.query({query: '*' + searchQuery + '*'}, function(result) {
$scope.otherEntities = result;
}, function(response) {
if(response.status === 404) {
$scope.otherEntities = OtherEntity.query({isActive: true});
}
});
} else {
@julienrf
julienrf / fb-page-feed.js
Created November 29, 2010 11:06
A small js snippet retrieving the feed of a Facebook page and displaying its elements.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script>
<script src="http://connect.facebook.net/fr_FR/all.js"></script>
<script>
// Replace the id by any other public page id
FB.api('170913076256527/feed', { limit: 3 }, function(result) {
$('#fb-feed').empty();
$(result.data).each(function(i, post) {
entry = $('<div class="fb-item"></div>');
if (post.icon) {
entry.append('<img class="icon" src="' + post.icon + '" />');