Skip to content

Instantly share code, notes, and snippets.

View hilios's full-sized avatar
🛠️
Breaking stuff

Edson Hilios hilios

🛠️
Breaking stuff
View GitHub Profile
@hilios
hilios / .bash_profile
Last active January 8, 2026 03:24
Default configuration for bash
# ~/.bash_profile: executed by bash(1) for login shells.
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
@hilios
hilios / email_validator.rb
Created August 24, 2011 20:10
Rails email validation
# http://my.rails-royce.org/2010/07/21/email-validation-in-ruby-on-rails-without-regexp/
# lib/email_validator.rb
require 'mail'
module ActiveModel
module Validations
class EmailValidator < ActiveModel::EachValidator
def validate_each(record,attribute,value)
begin
m = Mail::Address.new(value)
# We must check that value contains a domain and that value is an email address
@hilios
hilios / .htaccess
Created August 12, 2011 13:52
YSlow optimize DreamHost apache configuration (Gzip + Far late expire header)
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/html M3600
ExpiresByType text/css M3600
ExpiresByType application/javascript M3600
ExpiresByType image/bmp M3600
ExpiresByType image/gif M3600