This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Alexey Kalmakov | |
email = [email protected] | |
[core] | |
mergeoptions = --no-ff | |
pager = less -r | |
[alias] | |
vlog = log --pretty='%h (%an) %s' --graph | |
st = status | |
co = checkout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ее нужно поставить через твою среду разработки, ну или положить рядом с проектом | |
#include <AccelStepper.h> | |
#include <AceButton.h> | |
using namespace ace_button; | |
// Encoder | |
boolean TurnDetected; | |
boolean Up; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ее нужно поставить через твою среду разработки | |
#include <AccelStepper.h> | |
// Encoder | |
boolean TurnDetected; | |
boolean Up; | |
const int PinCLK = 18; | |
const int PinDT = 17; | |
const int PinSW = 16; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
- POSTGRES_PASSWORD=postgres | |
- POSTGRES_DB=postgres | |
ports: | |
- "5433:5433" | |
# Redis | |
redis: | |
image: redis:2.8.19 | |
hostname: redis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Фейковый npm | |
# Нужен для кэширования папки node_modules | |
# Кэш находится в папке ~/.cache/npm-inject/[sha1 хэш файла package.json]/node_modules | |
# | |
# В PATH надо добавить путь папки с фейковым npm, таким образом при выполнении команды `npm install` | |
# bash вызовет фейковый npm c параметром `install`. | |
# Фейк проверяет наличие папки [sha1 хэш файла package.json] в кэше. | |
# Если она в кэше, создаем на неё симлинк node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const findCellsInRadius = (w, h, center, radius) => { | |
let cellsInRadius = []; | |
let [centerX, centerY] = center; | |
_.range(w).forEach((x) => { | |
let rangeX = Math.abs(centerX - x); | |
(rangeX < radius) && _.range(h).forEach((y) => { | |
let rangeY = Math.abs(centerY - y); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[core] | |
autocrlf = true | |
mergeoptions = --no-ff | |
[user] | |
email = [email protected] | |
name = Alex Kalmakov | |
[help] | |
autocorrect = 1 | |
[alias] | |
# Shortcuts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dist/libs.js: app/bower_components/lodash/lodash.min.js node_modules/react/dist/react.min.js node_modules/redux/dist/redux.min.js | |
cat $? > $@ | |
libs: dist/libs.js | |
.PHONY: libs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in `env`; do | |
key=${i%=*} | |
[[ -z $short_env ]] && short_env=$key; | |
[[ ${#key} -lt ${#short_env} ]] && short_env=$key; | |
done | |
echo "Shortest env variable: $short_env" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import re | |
def count_substrings_re(string, substring): | |
substring_re = '(?=(%s))' % re.escape(substring) | |
return len(re.findall(substring_re, string)) | |
def count_substrings(s, f): | |
ind = 1 | |
count = 0 |