Skip to content

Instantly share code, notes, and snippets.

@lmarlow
lmarlow / date_formats.rake
Created July 22, 2008 22:53
Show available format strings for Date, DateTime, and Time objects in Rails
desc "Show the date/time format strings defined and example output"
task :date_formats => :environment do
now = Time.now
[:to_date, :to_datetime, :to_time].each do |conv_meth|
obj = now.send(conv_meth)
puts obj.class.name
puts "=" * obj.class.name.length
name_and_fmts = obj.class::DATE_FORMATS.map { |k, v| [k, %Q('#{String === v ? v : '&proc'}')] }
max_name_size = name_and_fmts.map { |k, _| k.to_s.length }.max + 2
max_fmt_size = name_and_fmts.map { |_, v| v.length }.max + 1
Hello, world!
@erichocean
erichocean / sprout-py.vcl
Created July 22, 2008 23:09
sprout-py.vcl
backend sproutcore {
set backend.host = "localhost";
set backend.port = "4020";
}
backend py {
set backend.host = "localhost";
set backend.port = "8000";
}
// ==========================================================================
// Ring.PhoneServerController
// ==========================================================================
require('core');
/** @class
(Document Your View Here)
[core]
editor = nano
pager = less
whitespace = trailing-space,space-before-tab,indent-with-non-tab
[color]
diff = auto
status = auto
branch = auto
interactive = auto
日本語あああ
<% view :contacts do %>
<div id="console"></div>
<h1>Contacts (<%= label_view :contacts_count, :outlet => true, :tag => :span, :bind => { :value => 'Ring.contactsController*content.count'} %>)</h1>
<% scroll_view :contacts_scroll, :outlet => true do %>
<%= list_view :contacts_list, :outlet => true,
:content_value_key => 'firstName',
:bind => { :content => 'Ring.contactsController.arrangedObjects'}
%>
/* Default CSS for welcome page. Delete this styling and replace it with your own. */
.ring_container {
position: absolute ;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
}
<% content_for('body') do %>
<%= container_view :ring_container, :bind => {:content => 'Ring.containerController*view'} %>
<% end %>
// ==========================================================================
// Ring.Contact Fixtures
// ==========================================================================
require('core') ;
Ring.FIXTURES = Ring.FIXTURES.concat([
// TODO: Add your data fixtures here.
// All fixture records must have a unique guid and a type matching the