Skip to content

Instantly share code, notes, and snippets.

View Zhomart's full-sized avatar
🏠
Working from home

Zhomart Mukhamejanov Zhomart

🏠
Working from home
View GitHub Profile
import request from 'superagent';
import errorStackParser from 'error-stack-parser';
import { merge } from 'object-state-storage';
class Rollbar {
constructor(logger) {
this._logger = logger;
this.setSessionId = this.setSessionId.bind(this);
$ ./metricbeat -e -c metricbeat.yml
2016/11/11 15:01:05.561060 beat.go:264: INFO Home path: [/Users/zhomart/Services/metricbeat-5.0.0-darwin-x86_64] Config path: [/Users/zhomart/Services/metricbeat-5.0.0-darwin-x86_64] Data path: [/Users/zhomart/Services/metricbeat-5.0.0-darwin-x86_64/data] Logs path: [/Users/zhomart/Services/metricbeat-5.0.0-darwin-x86_64/logs]
2016/11/11 15:01:05.561094 beat.go:174: INFO Setup Beat: metricbeat; Version: 5.0.0
2016/11/11 15:01:05.561168 logp.go:219: INFO Metrics logging every 30s
2016/11/11 15:01:05.561167 logstash.go:90: INFO Max Retries set to: 3
2016/11/11 15:01:05.561289 outputs.go:106: INFO Activated logstash as output plugin.
2016/11/11 15:01:05.561349 publish.go:291: INFO Publisher name: Zhomarts-MacBook-Pro.local
2016/11/11 15:01:05.561459 async.go:63: INFO Flush Interval set to: 1s
2016/11/11 15:01:05.561470 async.go:64: INFO Max Bulk Size set to: 2048
2016/11/11 15:01:05.561532 metricbeat.go:25: INFO Register [ModuleFactory:[system], MetricSetFactory:[apache/status
@Zhomart
Zhomart / error.md
Created November 10, 2016 18:40
Metricbeats 5.0 on mac os x producing errors for mongodb.status module

Configuration

    metricbeat.modules:
    - module: mongodb
      hosts:
        - localhost:27017
      metricsets:
        - status
      enabled: true
      period: 2s
# app/models/concerns/history_field_concern.rb
module HistoryFieldConcern
extend ActiveSupport::Concern
# consider using "before_save" and Changable
# https://github.com/mongodb/mongoid/blob/master/lib/mongoid/changeable.rb
included do
end
package main
import (
"bufio"
"fmt"
"os"
)
func Reverse(a []byte) {
n := len(a)
@Zhomart
Zhomart / introrx.md
Last active September 9, 2015 07:32 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@Zhomart
Zhomart / capybara cheat sheet
Last active August 29, 2015 14:27 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
76.2
68.4
67.2
64.4
60.8
59.8
59.6
56.6
54.6
53.4
@Zhomart
Zhomart / l2_firewall_STUDENT_ID.py
Created July 27, 2015 08:57
Template Firewall SDN Controller.
# Copyright 2011-2012 James McCauley
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,