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
@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

@dimoreira
dimoreira / cotacao-component (QuestionItem Autocomplete).html
Last active March 14, 2019 19:51
Correção Materialize Auto Init
<!-- START: QuestionItem -->
<li class="question-item card-panel">
<h2 class="intro-title">Vamos lá!</h2>
<div class="form-field standard">
<div class="field-control secondary autocomplete"> <!-- ADICIONADA A CLASSE AUTOCOMPLETE PARA DAR ESCOPO AO ESTILO -->
<input type="text" class="field-input destinationAutocomplete" name="destination"
placeholder="Pesquise seu destino" [(ngModel)]="selectedCountry" [ngbTypeahead]="search"
[resultTemplate]="rt" [inputFormatter]="formatter"/>
<label for="destination" class="field-label">Qual o seu destino?</label>
</div>
@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 / url_rating.js.coffee
Last active August 29, 2015 14:06
Conditional to show rating modal
$ ->
url = window.location.href;
# example url: https://www.example.com.br/users/123
urlPattern = /https:\/\/www.url.com.br\/users\/\d+/g;
if (url.match(urlPattern))
console.log 'Url match: show modal'
else
console.log 'Don\'t match'
@dimoreira
dimoreira / colors.sh
Created June 24, 2014 04:42
colors.sh
#!/usr/bin/env bash
for i in {0..255} ; do
printf "\x1b[38;5;${i}mcolour${i}\n"
done
@dimoreira
dimoreira / configuracao.md
Last active December 20, 2015 04:39
Configuração de Produção com RVM + Nginx + Unicorn no Ubuntu

Configuração de Produção com RVM + Nginx + Unicorn no Ubuntu


Comece instalando os linux headers necessários

$ sudo apt-get update
$ sudo apt-get install build-essential vim git-core curl
$ sudo apt-get install libcurl4-openssl-dev libx11-dev libffi-dev tcl-dev tk-dev
@dimoreira
dimoreira / MyVimRC
Created June 26, 2013 03:57
My .vimrc file for configuration
set encoding=utf-8
set number
syntax enable
set smartindent
set autoindent
set tabstop=4
set shiftwidth=4
set background=dark
colorscheme desert
@dimoreira
dimoreira / setup.md
Last active December 18, 2015 23:49
Production setup with RVM + Nginx + Unicorn in Ubuntu

Setup the RVM + Nginx + Unicorn in Ubuntu


Init by installing necessary linux headers

$ sudo apt-get update
$ sudo apt-get install build-essential vim git-core curl
$ sudo apt-get install libcurl4-openssl-dev libx11-dev libffi-dev tcl-dev tk-dev
@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>

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