Skip to content

Instantly share code, notes, and snippets.

View mrb's full-sized avatar
🍕
Helping companies market and sell more software

Michael Bernstein mrb

🍕
Helping companies market and sell more software
View GitHub Profile
def add_subagent_link(name, div)
link_to_function name do |page|
page.insert_html :top, div.to_sym, :partial => 'subagent', :object => CompanyCompany.new
end
end
.bigsansed
=link_to_function "Clients", nil do |page|
-@companies = @clients
-page.replace_html :companies, :partial => "companies"
<% Columnlog::Column.all.each do |column| %>
<div id="left" style="float:left;width:250px;padding:3px;margin:5px;">
<h1><%= column.name.capitalize %></h1>
<br/>
<% column.app.get(10).each do |post| %>
<b><%= post.body %></b><br/>
<i><%= post.posted_at %></i>
<p/>
<% end %>
</div>
- id: 4
name: text
title: Text
app_type: Text
url: http://wehavelazers.com
settings:
---
- title: News 12/5/08
body: Not too much news today! Not too much news today! Not too much news today! Not too much news today!
posted_at: Fri Dec 05 15:32:10 -0500 2008
- title: News 12/4/08
body: Not too much news today!
posted_at: Fri Dec 04 12:21:30 -0500 2008
This is a test!
@mrb
mrb / snippet.rb
Created December 17, 2008 16:16
undefined
module ActionView
module Helpers
class InstanceTag
def to_check_box_tag(options = {}, checked_value = "1", unchecked_value = "0")
options = options.stringify_keys
options["type"] = "checkbox"
options["value"] = checked_value
if options.has_key?("checked")
cv = options.delete "checked"
checked = cv == true || cv == "checked"
@mrb
mrb / snippet.rb
Created December 17, 2008 16:29 — forked from quirkey/snippet.rb
module ActionView
module Helpers
class InstanceTag
def to_check_box_tag(options = {}, checked_value = "1", unchecked_value = "0")
options = options.stringify_keys
options["type"] = "checkbox"
options["value"] = checked_value
if options.has_key?("checked")
cv = options.delete "checked"
checked = cv == true || cv == "checked"
def unique_name
errors.add_to_base "Full Name must be Unique" if Author.all.collect{|x| x.title}.include?("#{lastname.upcase}, #{firstname.upcase}")
end
>> d = "http://github.com/quirkey.atom"
=> "http://github.com/quirkey.atom"
>> Nokogiri::HTML(open(d).read).xpath('//entry').length
=> 20