Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View kohgpat's full-sized avatar
🤖
...

Nikolay Burlov kohgpat

🤖
...
  • Russia, Siberia
View GitHub Profile
const delay = (ms) = new Promise(resolve => setTimeout(resolve, ms));
var notify = require('gulp-notify');
function log() {
var args = Array.prototype.slice.call(arguments);
// Send error to notification center with gulp-notify
notify.onError({
title: 'Compile Error',
message: '<%= error %>'
}).apply(this, args);

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

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.

class Rover
attr_accessor :x, :y
def initialize(x, y, direction)
@x = x
@y = y
@direction = direction
@commands = []
end

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2

Results

@kohgpat
kohgpat / gist:7260506
Created November 1, 2013 03:12
ruby mavericks gcc not found fix
xcode-select --install
brew install apple-gcc42
@kohgpat
kohgpat / app.css
Last active December 26, 2015 12:29
twitter bootstrap layout with sidebar
/* twitter bootstrap */
.container {
max-width: 100%;
}
/* html */
html, body {
height: 100%;
}
@kohgpat
kohgpat / cv.md
Created September 24, 2013 15:04

Nikolay Burlov

Software Developer

@kohgpat at GitHub

Technologies

Backend development - Ruby, Sinatra, Ruby on Rails
Frontend development - CoffeeScript/JavaScript, jQuery, Angular.js
Databases - PostgreSQL, MySQL, MSSQL, MongoDB, Redis

@kohgpat
kohgpat / app.js
Created September 23, 2013 07:48
angular.js date filter using moment.js
angular.module("app.users", ["ngResource"]).factory("Users", function($resource) {
return $resource("users.json", {}, {get: {method: "GET", isArray: true}});
});
angular.module("app.filters", []).filter("date", function() {
moment.lang("ru");
return function(date) {
return moment(new Date(date)).format("L");
};
@kohgpat
kohgpat / app.js
Created September 23, 2013 07:25
angular.js currency filter using accounting.js
angular.module("app.users", ["ngResource"]).factory("Users", function($resource) {
return $resource("users.json", {}, {get: {method: "GET", isArray: true}});
});
angular.module("app.filters", []).filter("currency", function() {
return function(number, currencyCode) {
var currency = {
USD: "$",
RUB: ""
},