Skip to content

Instantly share code, notes, and snippets.

View ruslansavenok's full-sized avatar

Ruslan ruslansavenok

View GitHub Profile
@jswny
jswny / Flexible Dockerized Phoenix Deployments.md
Last active February 28, 2025 21:34
A guide to building and running zero-dependency Phoenix (Elixir) deployments with Docker. Works with Phoenix 1.2 and 1.3.

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

@CezaryDanielNowak
CezaryDanielNowak / script-performance-test.js
Last active December 19, 2015 09:49
Tool for testing script performance from console. It includes jquery
var testReplies = 10000,
use$ = false,
testCode = function() {
/* code to test */
//when use$ is enabled, $(this) is #actionBox, use it as your container
//#actionBox will be removed after test
},
actionBoxConfigure = function(){
/* put elements into actionBox here */
@nathos
nathos / no-select.scss
Last active April 3, 2020 23:44
Sass (SCSS) mixin to disable user-select on an element
@mixin no-select {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
@jlxw
jlxw / gist:3357795
Created August 15, 2012 08:56
Monkey patch to rate limit Rails Exception Notification / Notifier
ExceptionNotifier::Notifier.class_eval do
#https://github.com/smartinez87/exception_notification/blob/master/lib/exception_notifier/notifier.rb
def self.exception_notification(*args)
message = super
_limit = 5.minutes.ago
@@last_notification||=_limit
if @@last_notification > _limit
Rails.logger.info "ExceptionNotifier rate limit triggered, #{ExceptionNotifier::Notifier.deliveries.size} notifications limited."
message.delivery_method :test