Skip to content

Instantly share code, notes, and snippets.

View alexandre-mbm's full-sized avatar

Alexandre Magno alexandre-mbm

  • Natal (RN), Brazil
View GitHub Profile

locale_merge.rb

Dependencies:

sudo apt-get install ruby rails

Use:

curl -L http://git.io/locale_merge.rb | ruby - en.yml pt.yml > new-pt.yml
#!/usr/bin/env ruby
require 'json' # gem install json # also: activesupport (~> 2.3.18)
require 'rubygems' # gem install rubygems
require 'friendly' # gem install ihoka-friendly
Friendly.configure({
:adapter => "sqlite",
:database => "database.sqlite3"
})
@alexandre-mbm
alexandre-mbm / favicon.ico
Last active August 29, 2015 14:11 — forked from mikeymckay/friendly sqlite nosql sinatra
Example: Friendly + Sinatra
require 'tmpdir'
# Usage:
# add to ruhoh-site/plugins/publish/github.rb
# - Your GitHub remote must be setup properly but The command will try to walk you through it.
# - You must have a clean working directory to publish to GitHub pages since the hook is actually triggered by commits.
#
# $ cd ruhoh-site
# $ bundle exec ruhoh publish github
class Ruhoh
@alexandre-mbm
alexandre-mbm / fsplit.sh
Created June 25, 2015 02:00
Divide arquivo de texto em três partes e imprime os limites
#!/bin/bash
split -n l/3 content.txt
tr '\n' ' ' < xaa | sed -e "s/ */ /g" -e "s/\t//g" > xaa.0
tr '\n' ' ' < xab | sed -e "s/ */ /g" -e "s/\t//g" > xab.0
tr '\n' ' ' < xac | sed -e "s/ */ /g" -e "s/\t//g" > xac.0
mv xaa.0 xaa
mv xab.0 xab
@alexandre-mbm
alexandre-mbm / config.md
Last active August 29, 2015 14:25 — forked from gladson/config.md
Configuração Virtualenvs Webfaction
@alexandre-mbm
alexandre-mbm / 2015-08-12.md
Last active August 29, 2015 14:27
Documentando jornada com GRUB em EFI ou GPT

Segue o procedimento mais correto para mexer com GRUB a partir de LiveCD:

Em resumo: usar chroot.

1) Reatribuir montagens do sistema

root@ubuntu:/home/alexandre# mount --bind /dev mnt/dev
root@ubuntu:/home/alexandre# mount --bind /sys mnt/sys
root@ubuntu:/home/alexandre# mount --bind /proc mnt/proc
set old_root=$root
search.fs_uuid 3020b2c2-bdd1-4d60-a8b7-b29b1e4897e6 root hd1,gpt2
if [ $root != $old_root ]; then
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg
else
search --fs-uuid --no-floppy --set=root 746E-44FF
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw_BACKUP.efi
boot
fi
@alexandre-mbm
alexandre-mbm / README.md
Last active October 11, 2015 21:21
Download do curso de Shell Script montado por Júlio Neves e publicado na Linux Magazine

Para gerar a lista de arquivos a baixar:

bash write.sh > files.txt

Para fazer o download:

wget -c -i files.txt
@alexandre-mbm
alexandre-mbm / README.md
Last active October 20, 2015 03:21
(by guesswork) Accessibility test for the table of choosing of the GitHub's plans

(in portuguese) Isto é um ensaio de HTML básico para alcançar formas de implementar acessebilidade na tabela de escolha de planos de serviço que há durante o cadastro no GitHub. Experimente!

(in english) This is a basic HTML test to achieve ways of implementing accessibility in the table of choice of service plans that there is during the registration on GitHub. Try!!