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
chaliy / az_acr_auth,sh
Last active Aug 30, 2018
Oneliner that replicates `aws ecr get-login` for `az acr`
View az_acr_auth,sh
az acr credential show -n mysuperpuperregistry \
--query "join(' ', ['docker login mysuperpuperregistry-on.azurecr.io', '-u', username, '-p', password])" \
--output tsv | sh
View d3_example.js
var svg = d3.select(element[0])
.append('svg')
.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
@chaliy
chaliy / parse_lp_table_to_ical.py
Last active Aug 29, 2015
Parse time table of the Lvivska Politehnica and then convert to iCalendar format
View parse_lp_table_to_ical.py
# 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('http://lp.edu.ua/node/42?group=%D0%86%D0%A2%D0%9F-31%D0%B7&semestr=1')
#r.encoding = 'utf-8'
@chaliy
chaliy / fix_pandas_table.py
Last active Aug 29, 2015
Monkeypatch Pandas DataFrame to render tables with bootstrap styles. Still no lack with ugly black borders.
View fix_pandas_table.py
import pandas as pd
pd.DataFrame._repr_html_ = lambda self: self.to_html(classes='table table-striped')
View fooker1.py
# What output you expect form this?
class Fooker(object):
def __init__(self, items = []):
self.items = items
def append(self, item):
self.items.append(item)
o = Fooker()
View init_chat.skype
/set options +JOINING_ENABLED +HISTORY_DISCLOSED
// https://support.skype.com/en/faq/FA10042/what-are-chat-commands-and-roles
@chaliy
chaliy / print_quick_find_tree.py
Created Feb 3, 2014
Algorithm course has trees encoded as array, simple routine to draw grapth from it
View print_quick_find_tree.py
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]))
g1.write_png('print_tree.png')
@chaliy
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": "source.java",
"shell": true,
"variants":
[
{
"name": "Run",
"cmd": ["javac", "${file}", "&", "java", "${file_base_name}"]
View merge_sort.укр
процедура MergeSort (мод a: t) це
процедура Merge(арг a: t; Size: нат; рез b: t) це
змін i, j, k, r1, r2: нат;
поч
k <- 1;
поки k<=n повт
{визначення границь підмасивів}
i <- k; r1 <- i+Size-1;
якщо r1>n то r1 <- n кр;
j <- r1+1; r2 <- j+Size-1;
View watch_fsharpkoans.ps1
# You should have pswatch installed (http://psget.net/directory/pswatch/)
# You need small modification to the FSharpKoans/PathToEnlightenment.fs to make sure that you will not need to press any key
# Comment out
# printf "Press any key to continue..."
# System.Console.ReadKey() |> ignore
# 1. Open separate powershell window
# 2. Make sure you are in FSharpKoans solution folder
# 3. Run watch_fsharpkoans.ps1
# 4. Make both your visual studio and powershell window visitble at the same time
# 5. Enjoy!
You can’t perform that action at this time.