Skip to content

Instantly share code, notes, and snippets.

View somebody32's full-sized avatar

Ilya Zayats somebody32

View GitHub Profile
@somebody32
somebody32 / gist:383094db91513d9a2730
Last active August 29, 2015 14:16
Curator setup
# delete everything for reports older than 367 days
curator delete --older-than 367 --prefix intelligence-reports-
# optimize
curator optimize --older-than 2 --prefix intelligence-reports-
# RAW reports
curator delete --older-than 32 --prefix intelligence-raw-
curator optimize --older-than 2 --prefix intelligence-raw-
POST /_cluster/reroute?explain
{
"commands": [
{
"allocate": {
"index": "intelligence-reports-2014.08.16",
"shard": 0,
"node": "B4Yv-wpCSRqWIvncIyql0A"
}
}
Caused by: java.io.EOFException: read past EOF: NIOFSIndexInput(path="/var/lib/elasticsearch/elasticsearch/nodes/0/indices/intelligence-reports-2014.05.01/3/index/segments_2")
at org.apache.lucene.store.BufferedIndexInput.refill(BufferedIndexInput.java:336)
at org.apache.lucene.store.BufferedIndexInput.readByte(BufferedIndexInput.java:54)
at org.apache.lucene.store.DataInput.readInt(DataInput.java:98)
at org.apache.lucene.store.BufferedIndexInput.readInt(BufferedIndexInput.java:183)
at org.elasticsearch.common.lucene.Lucene.indexNeeds3xUpgrading(Lucene.java:738)
at org.elasticsearch.common.lucene.Lucene.upgradeLucene3xSegmentsMetadata(Lucene.java:749)
at org.elasticsearch.index.engine.InternalEngine.upgrade3xSegments(InternalEngine.java:1066)
at org.elasticsearch.index.engine.InternalEngine.<init>(InternalEngine.java:119)
... 9 more
@somebody32
somebody32 / test.js
Created September 8, 2015 08:48
Examples comma-first
// removing the first property
const my_obj = {
, test: 1 //fuuu
}
// when copying properties from another places
const my_obj = {
test: 1
, test2: 1
test3: 3 //fuu, forgot the comma, scanning are not helping in this case
@somebody32
somebody32 / Readme.md
Created September 12, 2015 14:24
How to convert multiline vars into separate let/const declarations

You can convert js-code like this:

var a = '1',
    b,
    c = '2';

into

@somebody32
somebody32 / circle.js
Created December 15, 2015 06:25
Generating SVG with React
import React from 'react';
export default class App extends React.Component {
render() {
return (
<svg>
<circle cx={50} cy={50} r={10} fill="red" />
</svg>
)
}
@somebody32
somebody32 / gist:bcbe4804d478a7a2edf8
Created December 16, 2015 16:38
Electron segfault with SW
Process: Electron [96680]
Path: /Applications/Electron.app/Contents/MacOS/Electron
Identifier: com.github.electron
Version: 0.36.0 (0.36.0)
Code Type: X86-64 (Native)
Parent Process: zsh [81235]
Responsible: Electron [96680]
User ID: 501
Date/Time: 2015-12-16 17:35:22.617 +0100
@somebody32
somebody32 / router.js
Last active January 26, 2016 19:21
Initial Router
import Backbone from 'backbone';
import $ from 'jquery';
export default Backbone.Router.extend({
routes: {
'': 'home',
'main_app_part': 'mainAppPart',
'about': 'about',
'heavy(/:heavy_param)': 'heavy',
'*handleMissingRoute': 'handle404',
@somebody32
somebody32 / index.js
Last active January 30, 2016 15:20
index.js
import Backbone from 'backbone';
import $ from 'jquery';
import Router from './router';
$(() => {
new Router();
Backbone.history.start();
});
@somebody32
somebody32 / index.js
Created January 26, 2016 19:17
./apps/index.js
import Router from './router';
export default () => {
new Router();
};