Skip to content

Instantly share code, notes, and snippets.

View simonedamico's full-sized avatar
🚫
‘undefined’ is not an object

Simone D'Amico simonedamico

🚫
‘undefined’ is not an object
View GitHub Profile

Keybase proof

I hereby claim:

  • I am simonedamico on github.
  • I am sim (https://keybase.io/sim) on keybase.
  • I have a public key whose fingerprint is FBE1 0386 AE8F 8156 5B83 1C5D ED47 1256 CA40 BAEB

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am neku on github.
  • I am sim (https://keybase.io/sim) on keybase.
  • I have a public key whose fingerprint is FBE1 0386 AE8F 8156 5B83 1C5D ED47 1256 CA40 BAEB

To claim this, I am signing this object:

require 'mechanize'
TP_USERNAME = ARGV[0] || 'yourusername'
TP_PASSWORD = ARGV[1] || 'yourpassword'
loop do
agent = Mechanize.new
agent.verify_mode = OpenSSL::SSL::VERIFY_NONE
auth_page = agent.get('https://1.1.1.1/login.html')
auth_form = auth_page.form
= form_for @comment do |f|
- if @comment.errors.any?
#error_explanation
%h2= "#{pluralize(@comment.errors.count, "error")} prohibited this comment from being saved:"
%ul
- @comment.errors.full_messages.each do |msg|
%li= msg
.field
= f.label :author
= render @post
= render partial: 'comments/form', object: Comment.new
@simonedamico
simonedamico / bridgesupport-ctags.cfg
Created May 6, 2012 17:42
Rubymotion ctags for Emacs
--langdef=bridgesupport
--langmap=bridgesupport:.bridgesupport
--regex-bridgesupport=/<constant +name='([A-Za-z0-9_]+)'/\1/c,constants/
--regex-bridgesupport=/<enum +name='([A-Za-z0-9_]+)'/\1/e,enumerations/
--regex-bridgesupport=/<function +name='([A-Za-z0-9_]+)'/\1/f,functions/
--regex-bridgesupport=/<class +name='([A-Za-z0-9_]+)'/\1/C,classes/
--regex-bridgesupport=/<method +selector='([A-Za-z0-9_:]+)'/\1/m,methods/
-e
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model
attr_accessible :name, :email, :password, :password_confirmation, :remember_me
end