Skip to content

Instantly share code, notes, and snippets.

Konstantin Kudryashov everzet

Block or report user

Report or block everzet

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jswny
jswny / Flexible Dockerized Phoenix Deployments.md
Last active Jul 10, 2019
A guide to building and running zero-dependency Phoenix (Elixir) deployments with Docker. Works with Phoenix 1.2 and 1.3.
View Flexible Dockerized Phoenix Deployments.md

Prelude

I. Preface and Motivation

This guide was written because I don't particularly enjoy deploying Phoenix (or Elixir for that matter) applications. It's not easy. Primarily, I don't have a lot of money to spend on a nice, fancy VPS so compiling my Phoenix apps on my VPS often isn't an option. For that, we have Distillery releases. However, that requires me to either have a separate server for staging to use as a build server, or to keep a particular version of Erlang installed on my VPS, neither of which sound like great options to me and they all have the possibilities of version mismatches with ERTS. In addition to all this, theres a whole lot of configuration which needs to be done to setup a Phoenix app for deployment, and it's hard to remember.

For that reason, I wanted to use Docker so that all of my deployments would be automated and reproducable. In addition, Docker would allow me to have reproducable builds for my releases. I could build my releases on any machine that I wanted in a contai

@npryce
npryce / Makefile
Created Dec 16, 2016
Pandoc Makefile example
View Makefile
MARKDOWN_SRC:=$(shell find doc -name '*.md')
DIAGRAM_SRC:=$(shell find doc -name '*.plantuml')
MARKDOWN_FORMAT=markdown+fenced_code_blocks+fenced_code_attributes+grid_tables+footnotes
# Order is significant when multiple CSS files
CSS_SRC:=styles/style.css
SITE_HTML=$(MARKDOWN_SRC:doc/%.md=out/site/%.html) $(DIAGRAM_SRC:doc/%.plantuml=out/site/%.png)
SITE_CSS=$(CSS_SRC:styles/%=out/site/%)
@efcasado
efcasado / eqc.md
Last active Apr 5, 2019
A gentle introduction to (Erlang) QuickCheck
View eqc.md

Erlang QuickCheck

What is QuickCheck?

QuickCheck is a language for stating properties of programs.

?FORALL(X, nat(), X*X >= 0)
@jakzal
jakzal / selenium.sh
Last active Feb 16, 2018
Selenium grid runner
View selenium.sh
#!/bin/sh
command=${1:-"help"}
SELENIUM_VERSION="2.39.0"
NODE_OPTIONS="-browser browserName=phantomjs"
download() {
[ -f selenium-server-standalone.jar ] || wget http://selenium.googlecode.com/files/selenium-server-standalone-${SELENIUM_VERSION}.jar -Oselenium-server-standalone.jar
}
@callado4
callado4 / behat-phantomjs-webdriver.md
Last active Apr 17, 2018
Instructions on how to make behat (with mink) use the phantomjs webdriver to run headless browser tests
View behat-phantomjs-webdriver.md

Making behat use phantomjs for the tests

If you want to run it on phantomjs (a headless browser) you can add this profile to your behat.yml and you need phantomjs >= 1.8.0

phantomjs:
    extensions:
        Behat\MinkExtension\Extension:
            base_url: http://dev.local
            goutte: ~
            selenium2:
                wd_host: "http://localhost:8643/wd/hub" 
@docteurklein
docteurklein / gist:5064805
Created Mar 1, 2013
failing test case for ReflectionMethod::getPrototype() when a class is using a trait that defines a method, chich class extends another class that defines the same method too.
View gist:5064805
<?php
trait TestTrait
{
public function getKernel()
{
}
}
class BaseTest
@blazarecki
blazarecki / PopupDictionary.php
Last active Aug 15, 2019
Alert, confirm and prompt with mink
View PopupDictionary.php
<?php
namespace Widop\Mink\Extension;
/**
* Dictionary to manage popups.
*
* @author Benjamin Lazarecki <benjamin.lazarecki@gmail.com>
*/
trait PopupDictionary
@spicycode
spicycode / tmux.conf
Created Sep 20, 2011
The best and greatest tmux.conf ever
View tmux.conf
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@bowsersenior
bowsersenior / stooge_loader.rb
Created May 18, 2011
A demo of YAML anchors, references and nested values
View stooge_loader.rb
require 'rubygems'
require 'yaml'
# A demonstration of YAML anchors, references and handling of nested values
# For more info, see:
# http://atechie.net/2009/07/merging-hashes-in-yaml-conf-files/
stooges = YAML::load( File.read('stooges.yml') )
# => {
# "default" => {
@thrashr888
thrashr888 / dColors.class.php
Created Jan 26, 2011
My class that I used to produce and convert color values.
View dColors.class.php
<?php
class dColors{
CONST WHITE = "#FFFFFF";
CONST BLACK = "#000000";
CONST RED = "#FF0000";
CONST GREEN = "#00FF00";
CONST BLUE = "#0000FF";
You can’t perform that action at this time.