Skip to content

Instantly share code, notes, and snippets.

View melekes's full-sized avatar

Anton Kaliaev melekes

View GitHub Profile

Keybase proof

I hereby claim:

  • I am melekes on github.
  • I am melekes (https://keybase.io/melekes) on keybase.
  • I have a public key ASA1kz6kxvacyRSjua9gxErX7nt2n46FvBFB-OfWYp572go

To claim this, I am signing this object:

@melekes
melekes / property-based-testing-tools.md
Last active May 15, 2021 11:38 — forked from npryce/property-based-testing-tools.md
Property-Based Testing Tools
@melekes
melekes / README.md
Last active August 11, 2016 11:28
How to learn any language in six months | Chris Lonsdale | TEDxLingnanUniversity

https://www.youtube.com/watch?v=d0yGdNEWdn0

Краткое содержание

Принципы:

  1. Фокусируйте внимание на контенте, имеющем для вас какое-то значение
  2. Используйте язык как средство для коммуникации начиная с первого дня
  3. Если вы сначала поймёте то, что вам хотели сказать, то вы начинаете овладевать языком бессознательно (comprehensive input)
  4. Изучение нового языка - это также тренировка тела (правильное произношение зависит от мышц)
@melekes
melekes / latency.txt
Created December 2, 2015 09:17 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms
@melekes
melekes / do_monad.erl
Last active December 27, 2019 08:47
Erlang snippets
-spec do(any(), [fun((...) -> any())]) -> any().
do(Arg, []) ->
Arg;
do(Arg, [Fun | Funs]) ->
case Fun(Arg) of
{error, Data} ->
Data;
Data ->
do(Data, Funs)
@melekes
melekes / Makefile
Last active August 29, 2015 14:15
Makefile for erlang projects
.PHONY: all compile deps clean distclean test docs xref dialyzer \
cleanplt
REBAR = `which rebar || ./script/rebar`
all: deps compile
compile: deps
@$(REBAR) compile
@melekes
melekes / AvgTemperatureDriver.java
Last active August 29, 2015 14:13
Writing to HBase From Hadoop Mapper
public class AvgTemperatureDriver extends Configured implements Tool {
@Override
public int run(String[] args) throws Exception {
Job job = new Job(getConf(), "Avg temperature");
job.setJarByClass(getClass());
job.setNumReduceTasks(0);
Scan scan = new Scan();
@melekes
melekes / Makefile
Created March 21, 2014 09:34
Colored Makefile for Golang projects
NO_COLOR=\033[0m
OK_COLOR=\033[32;01m
ERROR_COLOR=\033[31;01m
WARN_COLOR=\033[33;01m
DEPS = $(go list -f '{{range .TestImports}}{{.}} {{end}}' ./...)
deps:
@echo "$(OK_COLOR)==> Installing dependencies$(NO_COLOR)"
@go get -d -v ./...
@echo $(DEPS) | xargs -n1 go get -d
@melekes
melekes / companies.rb
Created November 13, 2013 15:05
Writing tests using FactoryGirl and validating presence of nested attributes (http://homeonrails.com/2012/10/validating-nested-associations-in-rails/) P.S. code not tested
require 'factory_girl'
FactoryGirl.define do
factory :company do
name "Twitter Corp."
before(:create) do |company, evaluator|
offices_attributes = []
3.times do # 3 offices per company
offices_attributes << attributes_for(:office)
@melekes
melekes / README.md
Last active August 8, 2018 05:19
Youtube Dashing widget

Youtube

Description

Dashing widget to play video from Youtube.

Installation

  1. Install Youtube widget