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
description "Example App" | |
author "Nobody" | |
start on filesystem or runlevel [2345] | |
stop on shutdown | |
# Automatically Respawn: | |
respawn | |
respawn limit 99 5 |
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
SearchSourceBuilder getSearchSourceBuilder(QueryWrapper queryWrapper) { | |
SearchSourceBuilder sourceBuilder = new SearchSourceBuilder() | |
if (queryWrapper.query) { | |
sourceBuilder.query(queryWrapper.query) | |
} | |
if (queryWrapper.fields) { | |
sourceBuilder.fields(queryWrapper.fields) | |
} |
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
IndexResponse search(ParamsWrapper queryWrapper) { | |
elasticSearchHelper.withElasticSearch { Client client -> | |
SearchSourceBuilder sourceBuilder = getSearchSourceBuilder(queryWrapper) | |
SearchRequest request = new SearchRequest() | |
request.searchType(SearchType.DFS_QUERY_THEN_FETCH).indices(queryWrapper.indices).types(queryWrapper.types).source(sourceBuilder) | |
log.debug "Query:$sourceBuilder" | |
SearchResponse response = client.search(request).actionGet() | |
return new IndexResponse(response) |
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
void indexAll() { | |
elasticSearchHelper.withElasticSearch { Client client -> | |
MyDomainClass.list().each { MyDomainClass instance -> | |
client.index { | |
index "myIndex" | |
type "myDomainClass" | |
id instance.id | |
source instance | |
} | |
} |
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
function ContactCtrl($scope, ContactService) { | |
$scope.firstName = ''; | |
$scope.lastName = ''; | |
$scope.getFullName = function() { | |
if ($scope.firstName !== '' && $scope.lastName !== '') { | |
return $scope.firstName + ', ' + $scope.lastName; | |
} else if ($scope.firstName !== '') { | |
return $scope.firstName; |
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
<form ng-controller="ContactCtrl"> | |
<label>Name</label> | |
<input type="text" ng-model="contact.name" /> | |
<label>Enabled</label> | |
<input type="checkbox" ng-model="contact.isEnabled()" /> | |
<div ng-show="contact.isFavorite()"> | |
<p>More data just for favorite contacts...</p> |
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
/** | |
* contact.js | |
**/ | |
var Contact = function () { | |
// Constructor, sets the defaults values of the object | |
var clazz = function (attributes) { | |
var defaults = { | |
id: null, |
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
app.controller('formCtl', function($scope, $location, $routeParams, contactService) { | |
var contactId = ($routeParams.id) ? parseInt($routeParams.id, 10) : null; | |
$scope.contact = (contactId) ? contactService.get(contactId) : new Contact(); | |
$scope.title = ($scope.contact.isNew()) ? 'Add New Contact' : 'Edit Contact'; | |
$scope.types = CONTACT_TYPES; | |
$scope.saveAction = function() { | |
if ($scope.contactForm.$valid) { | |
contactService.save($scope.contact); |
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
#!/bin/bash | |
BASE_PATH=`pwd` | |
MYSQL_ROOT_PASSWORD=root | |
echo "=== Creating 'wordpress_mysql' with (mysql:5.7) ===" | |
echo "=== Variables ===" | |
echo '$MYSQL_ROOT_PASSWORD=' XXXXXXXXXX | |
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
#!/bin/bash | |
BASE_PATH=`pwd` | |
WORDPRESS_DB_USER=root | |
WORDPRESS_DB_PASSWORD=root | |
WORDPRESS_DB_NAME=wordpress | |
APACHE_CONFIGURATION=$BASE_PATH/wordpress/000-default.conf | |
echo "=== Creating 'wordpress' with (wordpress) ===" | |
echo "=== Variables ===" |