Skip to content

Instantly share code, notes, and snippets.

View andreferraro's full-sized avatar
🎯
Focusing

Andre Ferraro andreferraro

🎯
Focusing
  • Brazil
  • 03:58 (UTC -03:00)
View GitHub Profile
#[...]
# Specify one or more NTP servers.
# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
# on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for
# more information.
server pool.ntp.br
server a.st1.ntp.br
server b.st1.ntp.br
#/bin/bash
service apparmor stop
service apparmor teardown
update-rc.d -f apparmor remove
apt-get remove apparmor apparmor-utils -y
apt-get purge apparmor -y
127.0.0.1 localhost
172.16.0.200 laravel.local laravel
@andreferraro
andreferraro / interfaces
Created July 23, 2015 03:43
/etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
#!/bin/bash
apt-get update
apt-get upgrade -y
apt-get install vim curl wget htop -y
@andreferraro
andreferraro / smtpteste.rb
Created January 28, 2012 02:11 — forked from geoffgarside/gist:157771
Validate Email Addresses Via SMTP
#!/usr/bin/env ruby
# Usage: $0 hostname email_addr
#
# Performs a basic SMTP delivery check, it connects to the target SMTP server, sends
# a HELO command, then a MAIL FROM followed by a RCPT TO. This should verify that
# the server is a) contactable b) permits the sender and c) accepts the recipient.
require 'socket'
require 'net/telnet'
me = Socket.gethostname
# RemoveAccents version 1.0.3 (c) 2008-2009 Solutions Informatiques Techniconseils inc.
#
# This module adds 2 methods to the string class.
# Up-to-date version and documentation available at:
#
# http://www.techniconseils.ca/en/scripts-remove-accents-ruby.php
#
# This script is available under the following license :
# Creative Commons Attribution-Share Alike 2.5.
#
pt-BR:
new: "novo"
edit: "editar"
show: "detalhes"
# Infelizmente não é possível colocar todas as regras...
#
# http://pt.wikipedia.org/wiki/Plural e
# http://pt.wikipedia.org/wiki/Singular
module Inflector
ActiveSupport::Inflector.inflections do |inflect|
inflect.clear
inflect.plural(/$/, 's')
inflect.plural(/(s)$/i, '\1')
require 'prawn/layout'
require 'prawn/format'
bill_address = @order.bill_address
ship_address = @order.ship_address
font "Helvetica"
image Spree::PrintInvoice::Config[:print_invoice_logo_path], :at => [0,720], :scale => 0.65