Skip to content

Instantly share code, notes, and snippets.

View edipox's full-sized avatar
:shipit:
Working from home

Edipo Vinicius da Silva edipox

:shipit:
Working from home
View GitHub Profile
@charusat09
charusat09 / deploy.rb
Last active October 23, 2019 00:24 — forked from dsandstrom/deploy.rb
Compile assets locally with capistrano 3.5.0 and rails 4.2.x (Nginx-Unicorn zero downtime)
# Runs rake assets:clean
# Defaults to nil (no asset cleanup is performed)
# If you use Rails 4+ and you'd like to clean up old assets after each deploy,
# set this to the number of versions to keep
set :keep_assets, 2
set :user, 'ubuntu'
set :pem_file, %w(/home/mayur/.ssh/pem/dev.pem)
set :ssh_options, {
@nikneroz
nikneroz / Guardian JWT.md
Last active October 10, 2023 19:13
Elixir + Phoenix Framework + Guardian + JWT. This is tutorial and step by step installation guide.

Elixir + Phoenix Framework + Guardian + JWT + Comeonin

Preparing environment

We need to generate secret key for development environment.

mix phoenix.gen.secret
# ednkXywWll1d2svDEpbA39R5kfkc9l96j0+u7A8MgKM+pbwbeDsuYB8MP2WUW1hf

Let's generate User model and controller.

Deploying Elixir and Phoenix applications using Docker and Exrm

Goal

By the end of this quick guide, you will know how to compile a Phoenix app release using Exrm and run it inside a Docker container. I've found only a couple of articles that discuss getting an Elixir app up and running inside a Docker container, and even those only touched on some parts of the process. The idea is that this guide will give you a full end-to-end example of how to get all the pieces and parts working together so that you are able to deploy your Phoenix application inside a Docker container.

Assumptions

  1. You already have a working Elixir environment with the Phoenix Framework installed
  2. You have at least basic working knowledge of Docker, and have installed the Docker tools onto your local environment
@taniadaniela
taniadaniela / product_factory.rb
Last active August 29, 2015 14:26
factory for add an image to a spree product
FactoryGirl.define do
factory :product_with_image, parent: :product do
after :create do |p|
image = File.open("spec/support/images/image.jpg")
p.images.create!(attachment: image, alt: p.name)
end
end
end
@ryndel
ryndel / .float-label.md
Last active November 2, 2017 11:45
Float label css only solution

Float label

A web component that create a CSS-only floating label for input tags

Usage

The syntax for generating a float-label input is as follows:

@irazasyed
irazasyed / homebrew-permissions-issue.md
Last active May 23, 2024 02:59
Homebrew: Permissions Denied Issue Fix (OS X / macOS)

Homebrew Permissions Denied Issues Solution

sudo chown -R $(whoami) $(brew --prefix)/*

@joho
joho / gist:3735740
Created September 17, 2012 05:40 — forked from rafaelss/gist:3700977
PostgreSQL 9.2 upgrade steps
Steps to install and run PostgreSQL 9.2 using Homebrew (Mac OS X)
(if you aren't using version 9.1.5, change line 6 with the correct version)
1. launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
2. mv /usr/local/var/postgres /usr/local/var/postgres91
3. brew update
4. brew upgrade postgresql
5. initdb /usr/local/var/postgres -E utf8
6. pg_upgrade -b /usr/local/Cellar/postgresql/9.1.5/bin -B /usr/local/Cellar/postgresql/9.2.0/bin -d /usr/local/var/postgres91 -D /usr/local/var/postgres
7. cp /usr/local/Cellar/postgresql/9.2.0/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
@pixelmatrix
pixelmatrix / Rakefile
Created July 22, 2010 19:34
Creating a prompt in a Rake Task
require "rake"
task :say_hi do
puts "What's your name?"
name = $stdin.gets.chomp
puts "Hi #{name}!"
end