Skip to content

Instantly share code, notes, and snippets.

View dimchansky's full-sized avatar

Dmitrij Koniajev dimchansky

View GitHub Profile
@dimchansky
dimchansky / README.md
Last active August 29, 2015 14:07 — forked from chrisjacob/README.md

Intro

Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").

Author: Chris Jacob @_chrisjacob

Tutorial (Gist): https://gist.github.com/833223

The Result

@dimchansky
dimchansky / ConvertRulesToJSON.cs
Last active August 29, 2015 14:17
Converts plain text request rules to JSON format
// add reference: Newtonsoft.Json
using System.Globalization;
using System.IO;
using System.Linq;
using Newtonsoft.Json;
namespace Rules.Transformation.Json
{
internal class Program
{
@dimchansky
dimchansky / MaybeMonad.cs
Last active August 29, 2015 14:17
Maybe monad in C#
using System;
namespace MaybeMonad
{
internal class Program
{
private static void Main()
{
var result = from a in "Hello ".ToMaybe()
from b in Nothing<string>.Instance
@dimchansky
dimchansky / Sorted-Word-Frequencies.hs
Created April 4, 2015 10:54
Counts the number of times each word appears in a (non-unicode) file and outputs result to other file sorting by frequencies and then by word (asc).
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TupleSections #-}
module Main where
import qualified Data.ByteString.Lazy as S
import qualified Data.ByteString.Lazy.Builder as SB
import qualified Data.ByteString.Lazy.Char8 as C
import Data.Foldable (foldMap)
import qualified Data.HashMap.Strict as HM
import Data.List (sortBy)
@dimchansky
dimchansky / introrx.md
Last active August 29, 2015 14:21 — forked from staltz/introrx.md

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.

@dimchansky
dimchansky / concurrency-in-go.md
Created October 4, 2015 17:50 — forked from kachayev/concurrency-in-go.md
Channels Are Not Enough or Why Pipelining Is Not That Easy
@dimchansky
dimchansky / app_deps.erl
Created November 14, 2012 07:17 — forked from ferd/app_deps.erl
Quick escript to generate a visualization of app dependencies in Erlang/OTP.
%%% Run with 'escript app_deps.erl'
%%% Change the path in filelib:wildcard/1 as required to capture all
%%% your dependencies.
%%%
%%% Rectangular nodes will represent library apps (no processes involved)
%%% and the circular nodes will represent regular apps. An arrow going from
%%% 'A -> B' means 'A depends on B'.
%%%
%%% This script depends on graphviz being present on the system.
-module(app_deps).
@dimchansky
dimchansky / Hubs.tt
Created April 29, 2013 20:50 — forked from robfe/Hubs.tt
<#@ template debug="true" hostspecific="true" language="C#" #>
<#@ output extension=".d.ts" #>
<# /* Update this line to match your version of SignalR */ #>
<#@ assembly name="$(SolutionDir)\packages\Microsoft.AspNet.SignalR.Core.1.0.0-rc1\lib\net40\Microsoft.AspNet.SignalR.Core.dll" #>
<# /* Load the current project's DLL to make sure the DefaultHubManager can find things */ #>
<#@ assembly name="$(TargetPath)" #>
<#@ assembly name="System.Core" #>
<#@ assembly name="System.Web" #>
<#@ assembly name="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" #>
<#@ assembly name="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" #>
@dimchansky
dimchansky / Hubs.tt
Created April 29, 2013 20:51 — forked from upta/Hubs.tt
<#@ template debug="true" hostspecific="true" language="C#" #>
<#@ output extension=".d.ts" #>
<# /* Update this line to match your version of SignalR */ #>
<#@ assembly name="$(SolutionDir)\packages\Microsoft.AspNet.SignalR.Core.1.0.1\lib\net40\Microsoft.AspNet.SignalR.Core.dll" #>
<# /* Load the current project's DLL to make sure the DefaultHubManager can find things */ #>
<#@ assembly name="$(TargetPath)" #>
<#@ assembly name="System.Core" #>
<#@ assembly name="System.Web" #>
<#@ assembly name="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" #>
<#@ assembly name="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" #>