Skip to content

Instantly share code, notes, and snippets.

View AndrewDryga's full-sized avatar

Andrew Dryga AndrewDryga

View GitHub Profile
@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 / .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 / 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 / reload_vb_kernel.sh
Created March 30, 2014 22:23
Shell script to rebuild VirtualBox kernel extensions under Mac OS X
#!/bin/bash
unload() {
if [ `ps -ef | grep -c VirtualBox$` -ne 0 ]
then
echo "VirtualBox still seems to be running. Please investigate!!"
exit 1;
elif [ `ps -ef | grep -c [V]ir` -gt 0 ]
then
echo "Stopping running processes before unloading Kernel Extensions"
@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 / erl-observe.sh
Last active July 11, 2023 01:20
Script for connecting Erlang Observer to remote node hosted in Kubernetes
#!/bin/bash
# This script provides easy way to debug remote Erlang nodes that is running in a kubernetes cluster.
# Usage: ./erl-observe.sh -l app=my_all -n default -c erlang_cookie
#
# Don't forget to include `:runtime_tools` in your mix.exs application dependencies.
set -e
# Trap exit so we can try to kill proxies that has stuck in background
function cleanup {
echo " - Stopping kubectl proxy."
@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