Skip to content

Instantly share code, notes, and snippets.

View radar's full-sized avatar

Ryan Bigg radar

View GitHub Profile
<% if logged_in? %>
Hello someone I know.
<% else %>
Wait, who are you?
<% end %>
ignore = ["id", "service_id", "created_at", "transfer_status", "updated_at", "order_response", "transfer_pw", "order_id", "transfer_id", "expiry_date", "domain_name"]
new_domain = DomainName.find_by_service_id(1230)
d.attributes.each do |x,y|
next if ignore.include?(x)
puts "#{x} -> #{y}"
new_domain.send("#{x}=", y)
end
class Entity < ActiveRecord::Base
belongs_to :client
has_many :group_members, :class_name => "Member", :foreign_key => "group_id"
has_many :users, :through => :group_members, :source => :entity
alias_method :orig_users, :users
def users
entity.everyone_group? ? orig_users : client.users
end
@radar
radar / gist:181698
Created September 6, 2009 07:23 — forked from linojon/gist:181696
def is_due?
past_due? ? true : (past_due if next_renewal_on <= Time.zone.today)
past_due?
end
@radar
radar / survey.md
Created November 2, 2009 01:05 — forked from markgandolfo/survey

What did you do to get good at Rails?

Built an online store, i jumped in the deep end, but after two months part time on rails, i got a cool little app working. From there, i kept building apps, and helping out on #rubyonrails

Who taught you what you know?

the crew at #rubyonrails, mainly you.

Do you have any fond (or not so fond) memories of your learning experiences?

@radar
radar / survey.md
Created November 2, 2009 01:16 — forked from chendo/survey

What did you do to get good at Rails?

I just kept at it and worked with it on a professional basis. Constantly learning about new things and working with people who do Rails is also a good start.

Who taught you what you know?

The internet, friends/coworkers and Dr Nic. That, and trial and error. I guess one of the benefits of Rails is many things are implicit and make sense, but sometimes it has quirks and the internet documents a lot of these quirks.

Do you have any fond (or not so fond) memories of your learning experiences?

@radar
radar / survey.md
Created November 2, 2009 11:55 — forked from tobyhede/survey

What did you do to get good at Rails? Initially started with the Agile Web Dev with Rails book, used that to build an all-AJAX Twitter app back when Twitter was shiney and new. Demo'd that to work and that rolled into a pilot project using Ruby/Rails to tie a couple of backend APIs together into a reporting app. I decided I loved it all so much that I began some client projects on the side.

Who taught you what you know? Mostly self-taught ... worked with other techs for many years, so most of the learning was in details of Ruby and the platform rather than "oh this is a model" level.

Do you have any fond (or not so fond) memories of your learning experiences? The first time I built AJAX using about 3 lines of code. Coming from PHP and Java this was all previously manual. These days everyone has been inspired by Rails, but it's very easy to forget that at the time it was so far aheadf of the curve it was like magic.

What was your first production app and what did you learn from it?

@radar
radar / survey.md
Created November 2, 2009 11:55 — forked from ivanvanderbyl/survey

What did you do to get good at Rails? I came from a PHP background, so the path I took was to workout how to do everything I knew with PHP in Ruby and Rails, as well as reading loads of source code and ripping parts out and making smaller apps.

Who taught you what you know? Mainly Google, I didn't know anyone using Rails for the first year or more.

Do you have any fond (or not so fond) memories of your learning experiences?

My first look at rails 3.0.pre and the steps to take to create and live with rails 3.0.pre that I came across.

Why was I looking at the secret Rails 3.0? Their generators are being migrated over to Thor and I wanted to see them in action. I might migrate newgem to use Thor too.

Here's a quick poke around of getting started and interesting things I found. Any hiccups and workarounds are meant as a guide to pre-pre-3.0 users/developers and not as a criticism of rails-core. Rails 3.0 is looking shiny and awesome.

Getting Started

As of today, you cannot install 3.0.pre from rubygems [1]. So, let's install them from source. Which is handy, you might like to patch something.

def update
@user = User.find(params[:id])
@user.photo = Photo.new(params[:user].delete(:photo))
if @user.update_attributes(params[:user])
flash[:notice] = "Account updated!"
redirect_to root_path
else
render :action => :edit
end