This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# mix.exs | |
defmodule RedisRabbitElixir.Mixfile do | |
use Mix.Project | |
def project do | |
[app: :redis_rabbit_elixir, | |
version: "0.0.1", | |
elixir: "~> 1.2", | |
build_embedded: Mix.env == :prod, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule LearningPlug do | |
use Plug.Builder | |
plug Plug.Logger | |
plug :extract_name | |
plug :greet, %{my_option: "Hello"} | |
def extract_name(%Plug.Conn{request_path: "/" <> name} = conn, opts) do | |
assign(conn, :name, the_name(name)) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RUBY_RELEASE_DATE = 2015-12-11 | |
SHELL = /bin/sh | |
NULLCMD = : | |
n=$(NULLCMD) | |
ECHO1 = $(V:1=$n) | |
RUNCMD = $(SHELL) | |
CDPATH = . | |
CHDIR = cd -P | |
exec = exec | |
NULL = /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vagrant@development:~$ apt list --installed | |
Listing... Done | |
accountsservice/now 0.6.35-0ubuntu7.1 amd64 [installed,upgradable to: 0.6.35-0ubuntu7.2] | |
acl/trusty,now 2.2.52-1 amd64 [installed,automatic] | |
adduser/trusty,now 3.113+nmu3ubuntu3 all [installed] | |
apparmor/trusty-security,now 2.8.95~2430-0ubuntu5.1 amd64 [installed,upgradable to: 2.8.95~2430-0ubuntu5.3] | |
apt/now 1.0.1ubuntu2.6 amd64 [installed,upgradable to: 1.0.1ubuntu2.10] | |
apt-transport-https/now 1.0.1ubuntu2.6 amd64 [installed,upgradable to: 1.0.1ubuntu2.10] | |
apt-utils/now 1.0.1ubuntu2.6 amd64 [installed,upgradable to: 1.0.1ubuntu2.10] | |
apt-xapian-index/trusty,now 0.45ubuntu4 all [installed,automatic] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
==> default: npm ERR! Error: No compatible version found: abbrev@'^1.0.5' | |
==> default: npm ERR! Valid install targets: | |
==> default: npm ERR! ["1.0.3","1.0.4","1.0.5","1.0.6","1.0.7"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module SecureAttributes | |
extend ActiveSupport::Concern | |
included do | |
# Load bcrypt gem only when SecureAttributes is used. | |
# This is to avoid ActiveModel (and by extension the entire framework) | |
# being dependent on a binary library. | |
begin | |
require 'bcrypt' | |
rescue LoadError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# test.rb | |
config.active_support.deprecation = -> (message, callstack) { | |
File.open("#{Rails.root}/deprecations", "a") do |f| | |
f.write message | |
f.write callstack.join("\n ") | |
f.write "\n" | |
end | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deploy-branch() { | |
stage=$1 | |
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) bundle exec cap $stage deploy | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def number_to_currency(number, options = {}) | |
if options[:currency_code].present? | |
options[:unit] = unit_from_currency_code(options[:currency_code]) | |
end | |
super | |
end | |
private |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt-get update -qq | |
sudo apt-get install -y git mercurial bison pkg-config mpd mpc libmpdclient2 libmpdclient-dev | |
# Install GVM | |
clean=no bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer) | |
source /home/vagrant/.gvm/scripts/gvm | |
gvm get | |
gvm update && source $HOME/.gvm/scripts/gvm |
NewerOlder