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
@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.

package main
import (
"bufio"
"fmt"
"os"
)
func Reverse(a []byte) {
n := len(a)
# 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
@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
$ ./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
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);
@Zhomart
Zhomart / setup-monit.yml
Created November 21, 2016 01:18
Ansible monit install script
---
# monit_version = '5.20.0'
- command: /usr/local/bin/monit --version
changed_when: False
failed_when: False
register: installed_monit
$ crystal spec spec/repo_spec.cr --error-trace --debug -s -t
Parse: 00:00:00.0005730 ( 0.19MB)
Semantic (top level): 00:00:00.1976770 ( 42.18MB)
Semantic (new): 00:00:00.0020550 ( 42.18MB)
Semantic (type declarations): 00:00:00.0269830 ( 50.18MB)
Semantic (abstract def check): 00:00:00.0010410 ( 50.18MB)
Semantic (ivars initializers): 00:00:00.0054870 ( 50.18MB)
Semantic (cvars initializers): 00:00:00.0116270 ( 50.18MB)
Semantic (main): 00:00:01.0783550 ( 202.62MB)
Semantic (cleanup): 00:00:00.0008790 ( 202.62MB)
@Zhomart
Zhomart / tensorflow-cpu.sh
Last active November 20, 2017 06:25
Compile and install tensorflow on Ubuntu 16.04. You might want to create a virtual machine on GCP, AWS, then compile tensorflow there. And then download compiled `*.wheel` file for further using it. List of compiled tensorflow with different options can be found here https://github.com/yaroslavvb/tensorflow-community-wheels/issues.
#!/bin/bash
##
## FROM https://github.com/floydhub/dl-docker
##
## Before running the script change versions and compilation flags below.
## If you're having trouble running the whole script, try running
## each command separately.
##
## List of compiled tensorflow packages https://github.com/yaroslavvb/tensorflow-community-wheels/issues