Skip to content

Instantly share code, notes, and snippets.

View akurkin's full-sized avatar
💛

Alex Kurkin akurkin

💛
View GitHub Profile

Vagrant Setup

This tutorial guides you through creating your first Vagrant project.

We start with a generic Ubuntu VM, and use the Chef provisioning tool to:

  • install packages for vim, git
  • create user accounts, as specified in included JSON config files
  • install specified user dotfiles (.bashrc, .vimrc, etc) from a git repository

Afterwards, we'll see how easy it is to package our newly provisioned VM

def unit_price(item)
if item.order.is_a?(Orders::DsrOrder) && item.eligible_for_dsr_discount?
item.stylist_price
else
item.price
end
end
@akurkin
akurkin / common.yml
Last active March 10, 2017 13:24
ROSI docker-compose.yml
#
# Shared definition of ruby microservice
#
microservice:
command: "runsvdir /etc/service"
environment:
PORT: 3000
RAILS_ENV: development
SERVICE_PLATFORM: "mia"
ports:
@akurkin
akurkin / egghead-screencast-guideline.md
Last active August 26, 2015 22:00 — forked from joelhooks/egghead-screencast-guideline.md
It seems trivial to record a 1-8 minute screencast, but there are actually quite a few moving parts when it comes to recording a **high quality** screencast. Here's some of our thoughts on the subject.

Recording a Great Coding Screencast

The Screen

First and foremost a coding screencast is about the code, and we need to make sure it looks great. There are a few aspects to this that help ensure that is the case.

Resolution

720p is the target resolution. In pixel terms this is 1280x720. We've gotten the best results when we record at 2560x1440 in a HiDPI (pixel double) mode, giving an effective visible resolution of 1280x720, but extremely crisp. This resolution is achievable on 27" monitors and retina MBPs.

@akurkin
akurkin / emberjs.md
Last active May 20, 2016 07:29
List of open source Ember 2.x applications

Elegant and beautifully implemented Ember 2.x applications.

Each app and repo is a perfect example to poke around when learning Ember 2.x framework

Hummingbird.me

Ember 2.x, Ember Data github repo (same repo for both frontend and backend)

  • OAuth2
  • JSONAPIAdapter
@akurkin
akurkin / nested.sql
Last active October 23, 2023 07:05 — forked from alexey-milovidov/nested.txt
Example of Nested data type in ClickHouse.
:) CREATE TABLE test.nested (EventDate Date, UserID UInt64, Attrs Nested(Key String, Value String)) ENGINE = MergeTree(EventDate, UserID, 8192)
CREATE TABLE test.nested
(
EventDate Date,
UserID UInt64,
Attrs Nested(
Key String,
Value String)
) ENGINE = MergeTree(EventDate, UserID, 8192)
@akurkin
akurkin / example.txt
Created June 19, 2016 18:27 — forked from alexey-milovidov/example.txt
Example of sequenceMatch aggregate function usage in ClickHouse.
$ clickhouse-client
ClickHouse client version 0.0.53720.
Connecting to localhost:9000.
Connected to ClickHouse server version 1.1.53981.
:) CREATE TABLE test.funnel (userID UInt64, eventType Enum8('A' = 1, 'B' = 2), EventTime Date, Age UInt8) ENGINE = Memory
CREATE TABLE test.funnel
(
userID UInt64,
@akurkin
akurkin / rounding_time.txt
Created June 21, 2016 17:35 — forked from alexey-milovidov/rounding_time.txt
Example of rounding time to 5-second interval in ClickHouse.
:) SELECT toDateTime(intDiv(toUInt32(EventTime), 5) * 5) AS k, count(), uniq(UserID) FROM hits_layer WHERE CounterID = 29761725 AND EventDate = today() AND EventTime >= now() - 600 GROUP BY k ORDER BY k
SELECT
toDateTime(intDiv(toUInt32(EventTime), 5) * 5) AS k,
count(),
uniq(UserID)
FROM hits_layer
WHERE (CounterID = 29761725) AND (EventDate = today()) AND (EventTime >= (now() - 600))
GROUP BY k
ORDER BY k ASC
@akurkin
akurkin / rounding_dates.txt
Created June 21, 2016 17:36 — forked from alexey-milovidov/rounding_dates.txt
Example of using date and datetime functions in ClickHouse.
:) SELECT toMonday(EventDate) AS k, count(), uniq(UserID) FROM hits_layer WHERE CounterID = 29761725 AND EventDate >= '2016-05-01' GROUP BY k ORDER BY k
SELECT
toMonday(EventDate) AS k,
count(),
uniq(UserID)
FROM hits_layer
WHERE (CounterID = 29761725) AND (EventDate >= '2016-05-01')
GROUP BY k
ORDER BY k ASC
@akurkin
akurkin / README.md
Created November 23, 2016 12:41 — forked from gdamjan/README.md
Setup for an easy to use, simple reverse http tunnels with nginx and ssh. It's that simple there's no authentication at all. The end result, a single ssh command invocation gives you a public url for your web app hosted on your laptop.

What

A lot of times you are developing a web application on your own laptop or home computer and would like to demo it to the public. Most of those times you are behind a router/firewall and you don't have a public IP address. Instead of configuring routers (often not possible), this solution gives you a public URL that's reverse tunnelled via ssh to your laptop.

Because of the relaxation of the sshd setup, it's best used on a dedicated virtual machine just for this (an Amazon micro instance for example).

Requirements