Skip to content

Instantly share code, notes, and snippets.

View av-ast's full-sized avatar

Alexey Astafyev av-ast

View GitHub Profile
" brew install vim --with-lua
"
" gem install haml-lint ruby-lint rubocop sass
" pip install pylint
" npm install -g js-yaml jsxhint eslint jsonlint
" https://github.com/ten0s/syntaxerl
set nocompatible
filetype off
" let mapleader="\<Space>"
" brew install vim --with-lua
"
" gem install haml-lint ruby-lint rubocop sass
" pip install pylint
" npm install -g js-yaml jsxhint eslint jsonlint
" https://github.com/ten0s/syntaxerl
set nocompatible
filetype off
" let mapleader="\<Space>"
require 'formula'
class Erln8 < Formula
homepage ''
url 'https://github.com/metadave/erln8/archive/erln8-0.9.9.tar.gz'
sha256 '9c48a97c72232bac352245f712430addb70ddf1b86d31d8beb19ab41e2c44bf8'
depends_on 'glib'
depends_on 'pkg-config' => :build
depends_on 'gettext'
depends_on 'libffi'
@av-ast
av-ast / postgresql-9.6.rb
Last active November 11, 2016 09:07
Homebrew formula for postgresql-9.6.0
class Postgresql96 < Formula
desc "Relational database management system"
homepage "https://www.postgresql.org/"
version = "9.6.0"
url "https://ftp.postgresql.org/pub/source/v#{version}/postgresql-#{version}.tar.bz2"
sha256 "3b5fe9634b80a4511aac1832a087586a7caa8c3413619562bdda009a015863ce"
head do
url "https://git.postgresql.org/git/postgresql.git", :branch => "REL9_6_STABLE"
@av-ast
av-ast / forward_ports.sh
Created May 26, 2015 08:49
Forward VM ports to localhost
#!/bin/bash
if [ "$#" -eq 0 ]; then
echo "USAGE: ./forward_ports.sh 1234 5678"
exit 1
fi
for port; do
echo "Forwarded port $port"
VBoxManage controlvm boot2docker-vm natpf1 "tcp-port$port,tcp,127.0.0.1,$port,,$port"
@av-ast
av-ast / raspbian.md
Last active August 29, 2015 14:21
raspbian tuning
  • Disable screen sleep
  • In order to set proper screen resolution set your /boot/config.txt content as following:
    disable_overscan=1
    hdmi_group=1
    hdmi_mode=16
@av-ast
av-ast / hbase.rb
Last active August 29, 2015 14:17
Hbase homebrew formula
class Hbase < Formula
homepage "http://hbase.apache.org"
url "http://apache-mirror.rbc.ru/pub/apache/hbase/hbase-0.98.11/hbase-0.98.11-hadoop2-bin.tar.gz"
sha1 "f44551ed7f1e078e6d1fc17385ffb762c815f14a"
depends_on "hadoop"
def install
rm_f Dir["bin/*.cmd", "conf/*.cmd"]
libexec.install %w[bin conf docs lib hbase-webapps]
@av-ast
av-ast / reltool_howto.txt
Last active December 28, 2015 18:09
Release Erlang app
mkdir sample && cd sample/
rebar create-app appid=sample
mkdir rel && cd rel/
rebar create-node nodeid=sample
cd ..
Дальше создаём rebar.config (если его ещё нет):
cat rebar.config
-module(benchmark).
-author('cooldaemon@gmail.com').
-export([run/1]).
run(Count) ->
Keys = lists:seq(1, Count),
lists:foreach(
fun ({F, TargetName}) ->
{[SetRunTime, SetWallClock], [GetRunTime, GetWallClock]} = F(Keys),
@av-ast
av-ast / M.hs
Last active December 24, 2015 16:59
Function to count sum of squares
module M where
sum_of_squares :: Int -> Int
sum_of_squares n = sum . filter odd . map(^2) $ take n [1..]
sum_of_squares_dotless :: Int -> Int
sum_of_squares_dotless = sum . filter odd . map(^2) . (enumFromTo 1)
main :: IO()
main = do