Skip to content

Instantly share code, notes, and snippets.

wget --mirror -p --convert-links -e robots=off -P . http://site.com.br
@manuwell
manuwell / gist:c75cf0cac3f22dbc1780
Created March 30, 2015 11:12
VIM find/replace multiple files

from: https://github.com/thoughtbot/til/pull/86/files

Search & Replace in multiple files

I recently had to replace static files path in multiple files from a project I were working on, after boggling my mind trying to do it with sed, I gave up and looked up how to do it using VIM, I was sure there was a way.

When VIM is started, you can specify multiple files to open as buffers from the

@manuwell
manuwell / gist:8112dfd08a14916054ae
Last active October 19, 2015 22:54
cedilla no ubuntu
http://linuxlegal.blogspot.com.br/2014/02/cedilha-no-ubuntu-1310-com-teclado.html
# on debian just edit the `/etc/default/keyboard` with:
XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT="intl"
XKBOPTIONS=""
@manuwell
manuwell / gist:ec5fd9c3b5f6417dec37
Created April 2, 2015 00:17
Sun Tzu - Conhecimento
quando não se conhece a si mesmo nem o seu inimigo, suas chances de ganhar as batalhas são próximas de zero
@manuwell
manuwell / chapter_1.md
Last active August 29, 2015 14:18
Pragmatic Programmers HighLights
  • Consideração pelo seu trabalho

  • pergunte! questione! Seja crítico.

  • PENSE! Nunca ande no piloto automático! Critique seu trabalho em tempo real

  • Assuma a responsabilidade! Seja realista!

  • Dê soluções, não desculpas.

@manuwell
manuwell / net.md
Last active July 23, 2016 14:25
Debugging Tools

Strace

strace -e trace=open,read ls /

File descriptos

  • which files and libs process PID uses lsof -p PID

  • which ports and protocols are listening lsof -s -p PID

@manuwell
manuwell / pre-push
Last active August 29, 2015 14:23
[Git-Hook] - Missing Deis Env Vars
#!/usr/bin/env ruby
# An example hook script to verify what is about to be pushed. Called by "git
# push" after it has checked the remote status, but before anything has been
# pushed. If this script exits with a non-zero status nothing will be pushed.
# This script shows a disclaimer with unsetted env vars on your deis cluster,
# only when you do a "git push deis master"
#
# It tries to read a ".env.sample" file to diff with your current set of env
@manuwell
manuwell / gist:1865e6ce8befe590a952
Created October 30, 2015 18:10
Capybara Rack Mount Point
require 'capybara/rails'
Capybara.app = Rack::Builder.new do
map "some_nested_url" do
run Rails.application
end
end.to_app
@manuwell
manuwell / git-log-json.md
Created December 2, 2015 22:18
git log with json format

Get Git log in JSON format

git log --pretty=format:'{%n  "commit": "%H",%n  "abbreviated_commit": "%h",%n  "tree": "%T",%n  "abbreviated_tree": "%t",%n  "parent": "%P",%n  "abbreviated_parent": "%p",%n  "refs": "%D",%n  "encoding": "%e",%n  "subject": "%s",%n  "sanitized_subject_line": "%f",%n  "body": "%b",%n  "commit_notes": "%N",%n  "verification_flag": "%G?",%n  "signer": "%GS",%n  "signer_key": "%GK",%n  "author": {%n    "name": "%aN",%n    "email": "%aE",%n    "date": "%aD"%n  },%n  "commiter": {%n    "name": "%cN",%n    "email": "%cE",%n    "date": "%cD"%n  }%n},'

The only information that aren't fetched are:

  • %B: raw body (unwrapped subject and body)
  • %GG: raw verification message from GPG for a signed commit
@manuwell
manuwell / Dockerfile
Last active June 1, 2017 17:51
Ruby Dockerfile
FROM alpine:3.2
MAINTAINER RakutenPayments <infra@rakutenpayments.com.br>
RUN \
echo 'gem: --no-document' >> ~/.gemrc && \
cp ~/.gemrc /etc/gemrc && \
chmod uog+r /etc/gemrc
ENV \