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! 😉
View GitHub Profile
#%RAML 0.8
title: World Music API
baseUri: http://example.api.com/{version}
version: v1
schemas:
- halLink: |
{ "$schema": "http://json-schema.org/schema",
"type": "object",
"description": "a Hypertext Application Language link",
@v-kolesnikov
v-kolesnikov / gist:e667f2fe980ec1b27768776f188b714a
Created April 17, 2016 12:40 — forked from wikimatze/gist:9790374
Github Two-Factor Authentication Failed For HTTPS

I heard from GitHub Two-Factor Authentication](https://github.com/blog/1614-two-factor-authentication) nearly a couple of days ago when I was reading my RSS feed. I enabled it and couldn' push to any of my repositories anymore. Learn in this blog post how to fix it.

Two-Factor Authentication

"Is a process involving two stages to verify the identity of an entity trying to access services in a computer or in a network". Github solves this authentication with sending an SMS to a device which wants to push to their platform.

Enabling Two-Factor Authentication

@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.
@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

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

Конфиги

Навигация

Различные способы перехода в режим вставки

i " вставить текст до курсора
@v-kolesnikov
v-kolesnikov / hexlet.slack.log
Last active May 31, 2021 11:10
почему дефолты в БД зло, Continuos Delivery
kirill.mokevnin [8:19 PM]
тут в соседнем чате спросили почему дефолты в базе зло, но по скольку это касается не только руби, предлагаю обсудить
kirill.mokevnin [8:19 PM]
тут
kirill.mokevnin [8:20 PM]
Кто согласен не согласен?
ivanlemeshev [8:21 PM]
/**
* @brief executeQueriesFromFile Read each line from a .sql QFile
* (assumed to not have been opened before this function), and when ; is reached, execute
* the SQL gathered until then on the query object. Then do this until a COMMIT SQL
* statement is found. In other words, this function assumes each file is a single
* SQL transaction, ending with a COMMIT line.
*/
void executeQueriesFromFile(QFile *file, QSqlQuery *query)
{