Skip to content

Instantly share code, notes, and snippets.

View anathematic's full-sized avatar

Thomas anathematic

View GitHub Profile
@anathematic
anathematic / sup.rb
Last active March 4, 2018 09:24 — forked from KamaKAzii/sup.rb
class Sup
attr_accessor :foo
def not_foo=(foo)
self.foo = foo
end
private
def calc_foo
@anathematic
anathematic / method.rb
Last active August 29, 2017 13:51 — forked from KamaKAzii/method.rb
def self.purchase_as_guest_with_data(data)
s = create_student_from_data(data)
p = create_parent_from_data(data)
s_user = User.new
s_user.contact = s
s_user.email = s.email
s_user.password = data[:student][:password]
p_user = User.new
@anathematic
anathematic / new.html.haml
Last active December 18, 2015 14:59 — forked from nigelr/gist:5801561
%h1 New vendor
= render 'form'
= link_to 'Cancel', vendors_path, id: :cancel_new_vendor_link
---------------------
_form.html.haml
= form_for @vendor, :html => { :class => 'form-horizontal' } do |f|
UserGuest.blueprint do
username
password "12345"
password_confirmation "12345"
role
email
comments
end
... and then in my blueprint.rb
// Each object in the json has a name. That's it. This will sort them.
json = json.sort(function (a,b) {
if (a.name < b.name) return -1;
if (a.name > b.name) return 1;
return 0;
});
@anathematic
anathematic / survey.md
Created November 16, 2009 10:10 — forked from radar/survey.md
  • What did you do to get good at Rails?
  • I wouldn't consider myself that good at rails however TDD and BDD (writing tests) REALLY helped me improve a lot
  • Who taught you what you know?
  • Mostly self fiddling / I've learnt a lot from the Mocra team (mostly Radar)
  • Do you have any fond (or not so fond) memories of your learning experiences?
  • Too many to list, this is a full time job for me
  • What was your first production app and what did you learn from it?