Skip to content

Instantly share code, notes, and snippets.

Mike Chaliy (Mykhailo Chalyi) chaliy

Block or report user

Report or block chaliy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
chaliy / JavaC.sublime-build
Created Feb 3, 2014
Sublime text Java build file modification, allows to run just compiled class
View JavaC.sublime-build
"cmd": ["javac", "$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "",
"shell": true,
"name": "Run",
"cmd": ["javac", "${file}", "&", "java", "${file_base_name}"]
chaliy /
Created Feb 3, 2014
Algorithm course has trees encoded as array, simple routine to draw grapth from it
import pydot
def print_tree(tree):
g1 = pydot.Dot(graph_type='graph')
for i in range(len(tree)):
g1.add_edge(pydot.Edge(i, tree[i]))
# What output you expect form this?
class Fooker(object):
def __init__(self, items = []):
self.items = items
def append(self, item):
o = Fooker()
chaliy /
Last active Aug 29, 2015
Monkeypatch Pandas DataFrame to render tables with bootstrap styles. Still no lack with ugly black borders.
import pandas as pd
pd.DataFrame._repr_html_ = lambda self: self.to_html(classes='table table-striped')
chaliy /
Last active Aug 29, 2015
Parse time table of the Lvivska Politehnica and then convert to iCalendar format
# coding=utf-8
import requests
from bs4 import BeautifulSoup
from icalendar import Calendar, Event
from datetime import date, datetime, time, timedelta
def read_table():
r = requests.get('')
#r.encoding = 'utf-8'
View d3_example.js
var svg =[0])
.attr('width', '99%')
.attr('height', '99%')
.attr('style', 'border: 1px solid silver; position: absolute; top: 0px; left: 0px; z-index: 1001');
var data = []
var refresh = function () {
var joints = svg
View first_attempt_to_use_rx.cs
using System;
using System.Collections.Generic;
namespace TryRx
class Program
static void Main(string[] args)
Order.Paid.Subscribe(_ => Console.WriteLine("Paid"));
View bank_in_fsharp.fs
module Bank
// Model
type Amount = decimal
type Balance = {
CurrentAmount: Amount
View can_you_guess_output.cs
class Program
static void Main(string[] args)
TestEvents test = new TestEvents();
var ff = new EventHandler<EventArgs>((s, e) => Console.WriteLine("Test"));
test.SomethingOccured += ff;
test.SomethingOccured += ff;
You can’t perform that action at this time.