Skip to content

Instantly share code, notes, and snippets.

View dimoreira's full-sized avatar
🏠
Working from home

Diego Moreira dimoreira

🏠
Working from home
View GitHub Profile
##
# Fazendo deploy com o capistrano de uma aplicação Rails
# usando servidores da Amazon ec2 e unicorn como servidor
# o versionamento do ruby no ambiente de produção foi feito
# com o rbenv ( https://github.com/sstephenson/rbenv ), o SO
# esta com o Centos 5.3 x64
#
# Primeiramente é necessario instalar a gem com o comando:
# gem install capistrano
# ou adicione a linha: gem "capistrano", :group => :development
@dimoreira
dimoreira / install.sh
Last active December 18, 2015 17:28 — forked from everaldo/install.sh
Configuração versão recente NGINX + Passenger
sudo apt-get -y update
sudo apt-get -y install build-essential zlib1g-dev git-core sqlite3 libsqlite3-dev libssl-dev libreadline-dev
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.profile
echo 'eval "$(rbenv init -)"' >> ~/.profile
source .profile
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
rbenv install --list #lista versões disponíveis do ruby
rbenv install 1.9.3-p374 # instala a última versão estável
rbenv rehash # sempre que instalar algum binário do ruby (gem ou versão) tem que rodar o rehash

Description

Heroku is a simple way to publish your Rails app, and a powerful platform that will allow it to scale. In this episode, Jay McGavren gets you started with your first Heroku app.

Set up your Rails app

Isolate your gem environment

  • You WANT Rails to fail locally if a gem isn't in your Gemfile
@dimoreira
dimoreira / example.html
Created June 21, 2013 15:01 — forked from kylebarrow/example.html
iOS Web App Links prevent open Safari
<!DOCTYPE html>
<head>
<title>Stay Standalone</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<script src="stay_standalone.js" type="text/javascript"></script>
</head>
<body>
<ul>
<li><a href="http://google.com/">Remote Link (Google)</a></li>
@dimoreira
dimoreira / password.js
Created July 26, 2017 05:00 — forked from soplakanets/password.js
Password hashing for node.js
var crypto = require('crypto');
var SaltLength = 9;
function createHash(password) {
var salt = generateSalt(SaltLength);
var hash = md5(password + salt);
return salt + hash;
}
@dimoreira
dimoreira / OSX-Convert-MOV-GIF.md
Created May 19, 2021 20:32 — forked from tskaggs/OSX-Convert-MOV-GIF.md
Creating GIFs from .MOV files in OSX using FFmpeg and ImageMagick

Convert MOV to GIF using FFmpeg and ImageMagick

I tried a few different techniques to make a GIF via command-line and the following gives me the best control of quality and size. Once you're all setup, you'll be pumping out GIFs in no time!

Preparation

Install FFmpeg

  • $ brew install ffmpeg [all your options]
    • Example: $ brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools

Install ImageMagick