ElasticSearch has the best performance when it has a lot of resources (open files and RAM) available.
#/etc/security/limits.conf
elasticsearch - nofile 65535
#!/bin/bash | |
NUM=0 | |
QUEUE="" | |
MAX_NPROC=2 # default | |
REPLACE_CMD=0 # no replacement by default | |
USAGE="A simple wrapper for running processes in parallel. | |
Usage: `basename $0` [-h] [-r] [-j nb_jobs] command arg_list | |
-h Shows this help | |
-r Replace asterix * in the command string with argument | |
-j nb_jobs Set number of simultanious jobs [2] |
#!/bin/sh | |
# NOTE: this script is largely inspired by Meteor install script, | |
# which can be found here: https://install.meteor.com | |
## NOTE sh NOT bash. This script should be POSIX sh only, since we don't | |
## know what shell the user has. Debian uses 'dash' for 'sh', for | |
## example. | |
# Is RESTX already installed (in /usr/local/bin (engine) or /usr/bin |
# i3status configuration file. | |
# see "man i3status" for documentation. | |
# It is important that this file is edited as UTF-8. | |
# The following line should contain a sharp s: | |
# ß | |
# If the above line is not correctly displayed, fix your editor first! | |
general { | |
colors = true |
class EmptyCollectionContractResolver : DefaultContractResolver { | |
protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization) { | |
JsonProperty property = base.CreateProperty(member, memberSerialization); | |
Predicate<object> shouldSerialize = property.ShouldSerialize; | |
property.ShouldSerialize = obj => (shouldSerialize == null || shouldSerialize(obj)) && !IsEmptyCollection(property, obj); | |
return property; | |
} | |
private bool IsEmptyCollection(JsonProperty property, object target) { |
/*** | |
* The following functionality is a custom-based poly-fill placeholder for AngularJS | |
* @example <input id="weight" name="weight" type="number" defaulttext="enter your weight" | |
* min="50" max="500" required /> | |
* For browsers lower than IE 10 the in-built placeholder functionality is used, otherwise | |
* the poly-fill is used | |
*/ | |
app.directive('defaulttext', function($timeout){ | |
if (!$.browser.msie || $.browser.version >= 10) { | |
return { |
/** | |
* General-purpose Event binding. Bind any event not natively supported by | |
* Angular Pass an object with keynames for events to ng-event Allows $event | |
* object and $params object to be passed | |
* | |
* @example <input ng-event="{ focus : 'counter++', blur : 'someCallback()' }"> | |
* @example <input ng-event="{ myCustomEvent : 'myEventHandler($event, | |
* $params)'}"> | |
* | |
* @param ng-event |
/** | |
* General-purpose validator for ngModel. angular.js comes with several built-in | |
* validation mechanism for input fields (ngRequired, ngPattern etc.) but using | |
* an arbitrary validation function requires creation of a custom formatters and / | |
* or parsers. The ng-validate directive makes it easy to use any function(s) | |
* defined in scope as a validator function(s). A validator function will | |
* trigger validation on both model and input changes. | |
* | |
* @example <input ng-validate=" 'myValidatorFunction($value)' "> | |
* @example <input ng-validate="{ foo : '$value > anotherModel', bar : |
app.directive('ng-numeric', function($log) { | |
return { | |
require: 'ngModel', | |
link: function (scope, element, attr, ngModelCtrl) { | |
function fromUser(text) { | |
var transformedInput = text.replace(/[^0-9]/g, ''); | |
$log.info(transformedInput); | |
if(transformedInput !== text) { | |
ngModelCtrl.$setViewValue(transformedInput); | |
ngModelCtrl.$render(); |