Skip to content

Instantly share code, notes, and snippets.

View Chervychnyk's full-sized avatar

Artem Chervychnyk

  • Ukraine, Dnepropetrovsk
View GitHub Profile
@Chervychnyk
Chervychnyk / .vimrc
Created October 6, 2021 09:24
Vim Config
" Disable compatibility with vi which can cause unexpected issues.
set nocompatible
" Enable type file detection. Vim will be able to try to detect the type of file in use.
filetype on
" Enable plugins and load plugin for the detected file type.
filetype plugin on
" Load an indent file for the detected file type.
@Chervychnyk
Chervychnyk / setup.sh
Last active June 30, 2021 11:03 — forked from bradp/setup.sh
New Mac Setup Script
echo "Installing xcode-stuff"
xcode-select --install
# Check for Homebrew, and then install it
if test ! "$(which brew)"; then
echo "Installing homebrew..."
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo "Homebrew installed successfully"
else
echo "Homebrew already installed!"
@Chervychnyk
Chervychnyk / release_tasks.ex
Last active March 31, 2024 15:53
Example of migration and seed tasks for phoenix release
defmodule YourApp.ReleaseTasks do
@app :your_app
@repos Application.get_env(:your_app, :ecto_repos, [])
def migrate() do
Application.load(@app)
for repo <- @repos do
{:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :up, all: true))
0x6eE327f434bac0C7cD6fb5A767840d327F98Cf2C
@Chervychnyk
Chervychnyk / redis.rb
Last active August 7, 2020 06:47 — forked from pubis/redis.rb
Custom Redis config
#config/initializers/redis.rb
require 'redis'
require 'redis/objects'
REDIS_CONFIG = YAML.load( File.open( Rails.root.join("config/redis.yml") ) ).symbolize_keys
dflt = REDIS_CONFIG[:default].symbolize_keys
cnfg = dflt.merge(REDIS_CONFIG[Rails.env.to_sym].symbolize_keys) if REDIS_CONFIG[Rails.env.to_sym]
$redis = Redis.new(cnfg)
Redis::Objects.redis = $redis