Skip to content

Instantly share code, notes, and snippets.

From 0db69f1e801ecc3695e64ad68bcd084c4c489c54 Mon Sep 17 00:00:00 2001
From: Jonathan Penn <[email protected]>
Date: Tue, 7 Oct 2008 14:08:52 -0400
Subject: [PATCH] Added unobtrusive_date_picker plugin
---
.gitmodules | 3 +++
vendor/plugins/unobtrusive_date_picker | 1 +
2 files changed, 4 insertions(+), 0 deletions(-)
create mode 160000 vendor/plugins/unobtrusive_date_picker
@jonathanpenn
jonathanpenn / gist:26025
Created November 18, 2008 02:51
Showing invisible characters in vim.
" Set the kind of invisible characters to show
" tabs, trailing spaces, non breaking spaces
set lcs=tab:>.,trail:•,nbsp:%
" Show invisible characters. Use "set nolist" to turn off.
set list
# This is the way it was in /lib/remarkable/rails.rb
Spec::Rails::Matchers.send(:include, Remarkable::Syntax::RSpec)
Spec::Example::ExampleGroupMethods.send(:include, Remarkable::Syntax::Shoulda)
# I believe this is the way it should be if you don't have your own remarkable specs defined
# Remarkable::Syntax::RSpec and Remarkable::Syntax::Shoulda aren't defined anywhere in the
# gem, but are in the plugin example in the tests, so I'm assuming this is what was meant
Spec::Rails::Matchers.send(:include, Remarkable::Syntax::RSpec) if defined?(Remarkable::Syntax::RSpec)
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:276:in `load_missing_constant': uninitialized constant Remarkable::Syntax (NameError)
from /Library/Ruby/Gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:468:in `const_missing'
from /Library/Ruby/Gems/1.8/gems/carlosbrando-remarkable-1.1.0/lib/remarkable/rails.rb:15
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:510:in `require'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:355:in `new_constants_in'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:510:in `require'
from /Library/Ruby/Gems/1.8/gems/carlosbrando-remarkable-1.1.0/lib/remarkable.rb:14
... 13 levels...
require 'rubygems'
require 'spec'
if not defined? BlankSlate
class BlankSlate
instance_methods.each { |m| undef_method m unless m =~ /^(__|instance_eval)/ }
end
end
class RDingus < BlankSlate
@jonathanpenn
jonathanpenn / rdingus_examples_spec.rb
Created December 23, 2008 02:40
Some examples on how RDingus might be used.
require File.dirname(__FILE__)+"/spec_helper.rb"
class Person
def initialize(name)
@name = name
end
def name
@name
#!/usr/bin/env ruby
#
# usage: script/server_restarter
#
# Rails autoloading, while nice in theory, frequently doesn't work. Since Rails 2.3+
# is so fast when completely reloading the server, I wrote this script to listen to the
# given directories, and kill/restart the server when any file is changed.
#
# It's quick, simple, and it reliably reloads your application when changes are made.
#
Some ideas for unobtrusive ajax pagination.
HTML Markup...
<div class="pagination_container">
<div class="pagination>
<a href="...">1</a>...
</div>
<div class="pagination_target">

Introduction

Forward (from PEP 8)

One of Guido’s key insights is that code is read much more often than it
is written. The guidelines provided here are intended to improve the
readability of code and make it consistent across the wide spectrum of
Python code. As PEP 20 6 says, “Readability counts”.

A style guide is about consistency. Consistency with this style guide is

require 'open-uri'
# url dsl -- the ultimate url dsl!
#
# You just can't beat this:
#
# $ irb -r url_dsl
# >> include URLDSL
# => Object
# >> http://github.com/defunkt.json