Skip to content

Instantly share code, notes, and snippets.

View AndrewDryga's full-sized avatar

Andrew Dryga AndrewDryga

View GitHub Profile
@AndrewDryga
AndrewDryga / .zshrc
Last active August 29, 2015 13:56
SublimeText3 and Oh-My-ZSH~ Config
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="simple"
# Example aliases
@AndrewDryga
AndrewDryga / fontselect.js
Last active December 21, 2015 09:49
Font selector
$(function() {
var fonts = [];
fonts.push({
name: 'Helvetica+Neue',
weight: [100, 300, 400, 700],
loaded: true
});
fonts.push({
name: 'Noto+Sans',
weight: [400, 700]
@AndrewDryga
AndrewDryga / sept2013
Created September 12, 2013 19:55
Результаты лотереи книг на CocoaHeads за Сентябрь 2013 by Nebo #15 nebo15.com
There were 20 items in your list. Here they are in random order:
ID: 1532295488 - Yuriy Pleskach
ID: 100003050466207 - Pavel Vasilenko
ID: 100000989843634 - Liza Leta
ID: 100000792125129 - Sergei Merenkov
ID: 1429875608 - Edward Grankovskyi
ID: 1790702252 - Loginov Oleg
ID: 100003070062622 - Oleksandr Gayovskyy
ID: 100001049823958 - Vitaliy Zamedyanskiy
@AndrewDryga
AndrewDryga / header.tpl
Last active February 8, 2016 08:51
YouTube Subtitles
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>{{$title}}</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="{{$description}}" />
<link rel="shortcut icon" href="/images/favicon.ico" />
<link rel="stylesheet" type="text/css" href="/css/main.css" />
{{IF $videos}}<link rel="stylesheet" type="text/css" href="/css/videos.css" />{{END}}
<meta name="google-site-verification" content="ylXpLfTMpsYwjaB0uSkVsYLbXFaywL7wsa7xqJl6tDw" />
@AndrewDryga
AndrewDryga / hrel.sh
Last active December 6, 2016 23:07
Hex.pm release bash script
#!/bin/bash
# This script simplifies releasing a new hex package.
# It will run following steps:
# 1. Run tests;
# 2. Create git tag with incremented version number (taken from mix.exs);
# 3. Start build for Hex.pm package.
#
# Usage:
# hrel [-v RELEASE_VERSION]
@AndrewDryga
AndrewDryga / keybase.md
Created March 22, 2017 19:08
keybase.md

Keybase proof

I hereby claim:

  • I am andrewdryga on github.
  • I am andrewdryga (https://keybase.io/andrewdryga) on keybase.
  • I have a public key ASCO83B78ctJpdof-fS5nIL6Gdvlenz5NAZvWbbgbKmhJAo

To claim this, I am signing this object:

@AndrewDryga
AndrewDryga / ael_simplified.ex
Last active August 1, 2017 19:44
AEL: Simplified code for context that is responsible for Signing URL's
defmodule Ael.Secrets.API do
def get_secret_url(secret) do
%Secret{
action: action,
expires_at: expires_at,
bucket: bucket,
resource_id: resource_id,
resource_name: resource_name
} = secret
@AndrewDryga
AndrewDryga / README.md
Created August 14, 2017 18:03
Elixir Refactoring Best Practice
  1. Revise folder sturcture and align everything without touching module names. Make sure everything is singular. Think about contexts. Don't forget about tests.
  2. Rename modules to match their file system path
  3. Refactor domain APIs to return {:ok, error} tuples, remove all error formatting from it
  4. Introduce fallback controller
  5. Go over all modules again and make sure naming is correct
  6. Remove all Elixir 1.5 and other warnings
  7. Bump deps and repeat
@AndrewDryga
AndrewDryga / rel_config.exs
Last active August 19, 2017 13:55
Configuration and Deployment article examples: rel/config.ex
use Mix.Releases.Config,
# This sets the default release built by `mix release`
default_release: :default,
# This sets the default environment used by `mix release`
default_environment: :default
environment :default do
# Copy files into release instead of creating symlink for them
set dev_mode: false
# Do not include ERTS
@AndrewDryga
AndrewDryga / config.exs
Created August 19, 2017 13:56
REPLACE_OS_VARS example
config :myapp_api, :third_party_lib,
cloud_name: "${CLOUDINARY_CLOUD_NAME}",
bucket_name: "${CLOUDINARY_BUCKET_NAME}",
bucket_region: "${CLOUDINARY_BUCKET_REGION}",
frontend_url: "${FRONTEND_URL}"