Skip to content

Instantly share code, notes, and snippets.

View v-kolesnikov's full-sized avatar
✍️
I'm writing something just now! You can write me too! 😉

Vasily Kolesnikov v-kolesnikov

✍️
I'm writing something just now! You can write me too! 😉
  • Russia
  • 06:56 (UTC +03:00)
View GitHub Profile
web: bundle exec rails s
job: bundle exec rails runner 'Delayed::Job.delete_all; Delayed::Worker.new.start'
@v-kolesnikov
v-kolesnikov / slack.clj
Created March 10, 2016 14:05 — forked from mikebroberts/slack.clj
Send a message to Slack incoming webhook in Clojure.
(ns slack
(:require [clj-http.client :as client]
[clojure.data.json :as json]))
(defn send-to-slack
"Sends a simple message to slack using an 'incoming webhook'.
url will be of form: https://myapp.slack.com/services/hooks/incoming-webhook?token=mytoken .
(Exact url you should use will appear on the slack integration page)
text will be any valid message.
This implementation could be expanded if you wanted to specify channel, username, etc.

Getting started

vagrant up
vagrant ssh
make install
make start
| * * |
| * * |
| * * |
| * * * |
| * * * |
| * * * * |
| * * * * * * * * |
| * * * |
| * * * * * * |
| * * * * * * |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from enum import IntEnum, unique
@unique
class Priority(IntEnum):
Lowest = 0
Low = 1
@v-kolesnikov
v-kolesnikov / 00_destructuring.md
Created February 6, 2016 17:28 — forked from john2x/00_destructuring.md
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors

@v-kolesnikov
v-kolesnikov / Dockerfile
Created January 27, 2016 15:00 — forked from mokevnin/Dockerfile
python handler for battle.hexlet.io
FROM hexlet/hexlet-base
RUN apt-install python-pip python-dev
RUN apt-install python3-pip python3-dev
RUN pip3 install pytest
ENV PYTHONDONTWRITEBYTECODE 1
@v-kolesnikov
v-kolesnikov / max_matrix_row_sum.clj
Last active December 20, 2015 08:44
Найти максимальную сумму элементов строки матрицы
(defn solution
[m]
(->> m
(map #(reduce + %))
(apply max)))
(let [m [[1 2 3]
[0 -1 2]
[4 1 -2]]]
(assert (= 6 (solution m))))
s.split.map { |x| x.mb_chars.capitalize.to_s }.join(" ")