Skip to content

Instantly share code, notes, and snippets.

@akurkin
akurkin / egghead-screencast-guideline.md
Last active Aug 26, 2015 — 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.
View egghead-screencast-guideline.md

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.

View README.md

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

View lne.rb
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 / emberjs.md
Last active May 20, 2016
List of open source Ember 2.x applications
View emberjs.md

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 / example.txt
Created Jun 19, 2016 — forked from alexey-milovidov/example.txt
Example of sequenceMatch aggregate function usage in ClickHouse.
View example.txt
$ 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 Jun 21, 2016 — forked from alexey-milovidov/rounding_time.txt
Example of rounding time to 5-second interval in ClickHouse.
View rounding_time.txt
:) 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 Jun 21, 2016 — forked from alexey-milovidov/rounding_dates.txt
Example of using date and datetime functions in ClickHouse.
View rounding_dates.txt
:) 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 Nov 23, 2016 — 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.
View README.md

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

@akurkin
akurkin / common.yml
Last active Mar 10, 2017
ROSI docker-compose.yml
View common.yml
#
# Shared definition of ruby microservice
#
microservice:
command: "runsvdir /etc/service"
environment:
PORT: 3000
RAILS_ENV: development
SERVICE_PLATFORM: "mia"
ports:
@akurkin
akurkin / docker-cleanup-resources.md
Created Jul 25, 2017 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks
View docker-cleanup-resources.md

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm