Skip to content

Instantly share code, notes, and snippets.

View mahnunchik's full-sized avatar
🤪
I may be slow to respond.

Evgeny mahnunchik

🤪
I may be slow to respond.
View GitHub Profile
input {
lumberjack {
# The port to listen on
port => 12345
# The paths to your ssl cert and key
ssl_certificate => "/opt/ssl/logstash-forwarder.key"
ssl_key => "/opt/ssl/logstash-forwarder.crt"
}
}
@mahnunchik
mahnunchik / Cakefile
Created February 21, 2013 05:31
Browserify helper for Cakefile
###*
* @param options.watch - set watches on files, see below
* @param options.cache - turn on caching for AST traversals, see below
* @param options.debug - turn on source mapping for debugging with //@ sourceURL=... in browsers that support it
* @param options.exports - an array of the core items to export to the namespace. Available items: 'require', 'process'
* @param options.require - Require a file or files for inclusion in the bundle.
* @param options.entry - Append a file to the end of the bundle and execute it without having to require() it.
* @param options.filter - Transform the source using the filter function fn(src). The return value of fn should be the new source.
* @param options.handlers - Register a handler to wrap extensions.
###
wait = (functions, cb)->
completed = []
functions.forEach (func, index)->
func ()->
if completed.indexOf(index) is -1
completed.push(index)
if completed.length is functions.length
cb()
wait [
@mahnunchik
mahnunchik / test perfomance toUpperCase
Last active December 16, 2015 05:09
node test.js without toUpperCase: 1ms with toUpperCase: 9ms
console.time('without toUpperCase');
for(var i=0; i < 100000; i++){
var str = "sOmeStR";
if(str == "sOmeStR"){
//console.log('==');
}
}
console.timeEnd('without toUpperCase');
console.time('with toUpperCase');
#!/bin/sh
curl -XDELETE 'http://localhost:9200/testindex'
echo "\nIndex deleted"
curl -XPOST 'http://localhost:9200/testindex' -d '{
"settings": {
"analysis": {
"analyzer": {
#!/bin/sh
# Запрос только по тексту, находим 1 запись (Японская AND корпорация)
echo "query_string search:"
curl -XPOST 'http://localhost:9200/testindex/testtype/_search?pretty' -d '{
"sort": [
{
"_id": {
#!/bin/sh
# Запрос с учетом морфологии
echo "query_string search:"
curl -XPOST 'http://localhost:9200/testindex/testtype/_search?pretty' -d '{
"sort": [
{
"_id": {
#!/bin/sh
curl -XDELETE 'http://localhost:9200/testindex'
echo "\nIndex deleted"
curl -XPOST 'http://localhost:9200/testindex' -d '{
"settings": {
"analysis": {
"analyzer": {
#!/bin/sh
curl -XDELETE 'http://localhost:9200/testindex'
echo "\nIndex deleted"
curl -XPOST 'http://localhost:9200/testindex' -d '{
"settings": {
"analysis": {
"analyzer": {