This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
# | |
# Add this to the bottom of environment.rb | |
# | |
require 'smtp_tls' | |
ActionMailer::Base.delivery_method = :smtp | |
ActionMailer::Base.raise_delivery_errors = true | |
ActionMailer::Base.smtp_settings = { |
# When a spammer wants to attack your site, they'll likely send an automated bot | |
# that will blindly fill out any forms it encounters. The idea of a "honeypot" is that | |
# you place a hidden field in a form. That's the honeypot. If this field is filled in, then | |
# it's almost certain to be a spammer (since a normal user wouldn't have even seen the | |
# field), and the contents of the form can safely be discarded. | |
# Normally, you would implement a "honeypot" in a Rails app with some combination of a | |
# special field in a particular form, and then some logic in the corresponding controller that | |
# would check for content in the "honeypot" field. This is somewhat of an inefficient | |
# approach, because it requires special code (not DRY), and bots are still going through an |
# http://www.jamesbritt.com/2007/12/18/sending-mail-through-gmail-with-ruby-s-net-smtp | |
# http://d.hatena.ne.jp/zorio/20060416 | |
require "openssl" | |
require "net/smtp" | |
Net::SMTP.class_eval do | |
private | |
def do_start(helodomain, user, secret, authtype) | |
raise IOError, 'SMTP session already started' if @started |
development: &global_settings | |
database: textual_development | |
host: 127.0.0.1 | |
port: 27017 | |
test: | |
database: textual_test | |
<<: *global_settings | |
production: |
file = File.new("output.jpg", "wb") | |
file << [str].pack('H*') | |
file.close |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
# ~/.tmux.conf | |
# | |
# See the following files: | |
# | |
# /opt/local/share/doc/tmux/t-williams.conf | |
# /opt/local/share/doc/tmux/screen-keys.conf | |
# /opt/local/share/doc/tmux/vim-keys.conf | |
# | |
# URLs to read: | |
# |
desc "Create about and revision files." | |
task :rev_deployment, :roles => [:app, :web] do | |
require 'grit' | |
require 'chronic' | |
# include Grit | |
work_dir = File.join(File.dirname(__FILE__), '../../') | |
g = Grit::Repo.new(work_dir) | |
since = Chronic.parse('last week friday') | |
msg = "\n" | |
rev_file = File.join(File.dirname(__FILE__), '../../','tmp/revision.txt') |
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
; | |
; Netatalk 3.x configuration file | |
; http://netatalk.sourceforge.net/3.0/htmldocs/afp.conf.5.html | |
; | |
[Global] | |
; Global server settings | |
vol preset = default_for_all_vol | |
log file = /var/log/netatalk.log | |
uam list = uams_dhx.so,uams_dhx2.so |