Skip to content

Instantly share code, notes, and snippets.

View wevtimoteo's full-sized avatar
🎲
Rolling dices

Weverton Timoteo wevtimoteo

🎲
Rolling dices
View GitHub Profile
@tapajos
tapajos / gist:1811460
Created February 12, 2012 23:05
Migrando do Heroku para a Amazon Web Services

Migrando do Heroku para a Amazon Web Services

Recentemente eu comentei sobre a migração que fizemos no [Myfinance][mf] saindo do [Heroku][h] e indo para a [Amazon Web Services][a] e diversas pessoas me perguntaram as razões pela qual fizemos essa mudança. O objetivo desse post é apenas explicar a decisão que a nossa equipe tomou, como foi e as conseguências dessa migração.

Antes de começar eu gostaria de deixar claro que o objetivo desse texto não é comparar hospedagens e nem dizer que uma é melhor do que a outra. Trata-se apenas do relato de uma experiência.

A motivação

Antes de explicar a motivação por trás da migração é interessante mostrar como era a nossa estrutura.

@guyboltonking
guyboltonking / compressed_static_assets.rb
Created March 21, 2012 20:37
Slightly hacky rails middleware for serving up precompiled gzipped assets
require 'action_dispatch/middleware/static'
module Middleware
class FileHandler < ActionDispatch::FileHandler
def initialize(root, assets_path, cache_control)
@assets_path = assets_path.chomp('/') + '/'
super(root, cache_control)
end
def match?(path)
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 31, 2024 22:29
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@unak
unak / history.txt
Last active November 29, 2021 01:40
The History of Ruby
* Only the releases of the stable versions are listed in principle. The releases of the unstable versions especially considered to be important are indicated as "not stable."
* The branches used as the source of each releases are specified, and the branching timing of them are also shown. BTW, before subversionizing of the repository, the term called "trunk" was not used, but this list uses it in order to avoid confusion.
* In order to show a historical backdrop, big conferences (RubyKaigi, RubyConf and Euruko) are also listed. About the venues of such conferences, general English notations are adopted, in my hope.
* ruby_1_8_7 branch was recut from v1_8_7 tag after the 1.8.7 release because of an accident.
* 1.2.1 release was canceled once, and the 2nd release called "repack" was performed. Although there were other examples similar to this, since the re-releases were performed during the same day, it does not write clearly in particular.
* Since 1.0 was released with the date in large quantities, the mi
@squiter
squiter / Vagrantfile
Created July 5, 2012 21:12
[Abstraindo] Vagrant de forma simples - Arquivos finais
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.box = "lucid32"
config.vm.forward_port 80, 8080
config.vm.forward_port 3306, 8336
config.vm.provision :puppet do |puppet|
@nuxlli
nuxlli / unix_socket_request.sh
Last active January 25, 2024 04:37
Examples of http request in unix domain socket with shell, using socat, netcat or curl
#!/bin/bash
# References
# http://www.computerhope.com/unix/nc.htm#03
# https://github.com/daniloegea/netcat
# http://unix.stackexchange.com/questions/26715/how-can-i-communicate-with-a-unix-domain-socket-via-the-shell-on-debian-squeeze
# http://unix.stackexchange.com/questions/33924/write-inside-a-socket-open-by-another-process-in-linux/33982#33982
# http://www.linuxjournal.com/content/more-using-bashs-built-devtcp-file-tcpip
# http://www.dest-unreach.org/socat/
# http://stuff.mit.edu/afs/sipb/machine/penguin-lust/src/socat-1.7.1.2/EXAMPLES
@geeksam
geeksam / dsl-or-api-checklist.md
Last active June 12, 2017 20:46
The "Is It a DSL or an API?" Ten Question Checklist

[NOTE: The original version was posted in 2007 on an O'Reilly blog, but the page has been erroring out for months now. I'm copying it here because archive.org, while useful, can be slow. chromatic is a lovely person who (he thinks) probably has copyright to this piece.]


The "Is It a DSL or an API?" Ten Question Checklist

Saturday May 19, 2007 6:00AM
by chromatic in Opinion

@joyrexus
joyrexus / README.md
Last active June 8, 2023 07:45
form-data vs -urlencoded

Nice answer on stackoverflow to the question of when to use one or the other content-types for POSTing data, viz. application/x-www-form-urlencoded and multipart/form-data.

“The moral of the story is, if you have binary (non-alphanumeric) data (or a significantly sized payload) to transmit, use multipart/form-data. Otherwise, use application/x-www-form-urlencoded.”


Matt Bridges' answer in full:

The MIME types you mention are the two Content-Type headers for HTTP POST requests that user-agents (browsers) must support. The purpose of both of those types of requests is to send a list of name/value pairs to the server. Depending on the type and amount of data being transmitted, one of the methods will be more efficient than the other. To understand why, you have to look at what each is doing

Github Two-Factor Authentication (2FA) for Brazil via SMS

The Github doesn't provide country code for Brazil (+55). To add this option, just run the code below in your console. The option Brazil +55 will be the first on the list, already selected:


🇧🇷 [pt-BR]

Autenticação em dois fatores (2FA) do GitHub para o Brasil via SMS

@nuxlli
nuxlli / Azkfile.js
Created November 3, 2015 20:37
"bins" example in Azkfile
aliases({
bundle : { command: ["bundle", "exec"]}, // system: azkdemo (default)
scaffold : { alias: "bundle", append: ["rails", "g", "scaffold"]},
test : { alias: "bundle", append: ["rake", "test"], tty: true, context: 'test'},
'import-db': { system: "mysql", command: ["mysql"], depends: false}
});
// azk script generator --path ./script
// ./script/bundle
// ./script/scaffold