Skip to content

Instantly share code, notes, and snippets.

View janxious's full-sized avatar
🌰
.

Joel "The Gregarious" Meador janxious

🌰
.
View GitHub Profile
@janxious
janxious / Notes About Ruby Hoedown
Created September 3, 2009 18:06
Ruby Hoedown 2009 Notes
Cucumber Talk - 9AM Fri - Ben Mabey - benmabey.com
placing emphasis on features instead of overall product goals
check wip in cucumber; can limit the number of tests to use with a given tag?
Check out webrat
"specify outcome, not implementation"
<%# Total number of tickets for this customer by time frame -%>
<table>
<thead>
<tr>
<th>Timeframe</th>
<th>Opened</th>
<th>Closed</th>
</tr>
</thead>
<tbody>
types {
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/x-javascript js;
application/atom+xml atom;
application/rss+xml rss;
#!/usr/bin/env ruby
# this script can be used to find out what colours will look like on your terminal all in one go
module TermColours
@attributes = [0,1,4,5,7]
@foregrounds = 30..37
@backgrounds = 40..47
def self.print_all_attribute_foreground_background_combinations
@attributes.each do |attr|
#!/usr/bin/env ruby
# this script can be used to find out what colours will look like on your terminal all in one go
module TermColours
@attributes = [0,1,4,5,7]
@foregrounds = 30..37
@backgrounds = 40..47
def self.print_all_attribute_foreground_background_combinations
@attributes.each do |attr|
@janxious
janxious / propane - cf_chat.css
Created January 28, 2010 19:47
some css for styling propane
#upload_target {
display:none ! important;
}
div.bottom {
padding:0px ! important;
margin:0px ! important;
background-image: none ! important;
}
div#last_message{
display:none ! important;
@janxious
janxious / activesupport.rb
Created January 31, 2010 22:07 — forked from expectedbehavior/activesupport.rb
Test::Unit Cucumber-style Tagging
module ActiveSupport
module Testing
module Declarative
alias :tu_test_original :test
# test "verify something", [:slow, :wip] do
# ...
# end
def test(name, tags = nil, &block)
# -*- coding: utf-8 -*-
module Color
COLORS = { :clear => 0, :red => 31, :green => 32, :yellow => 33, :magenta => 35 }
end
class Test::Unit::Slow
alias :old_long_display :long_display
def long_display
time_index = /\d+\.\d+s$/ =~ old_long_display
time = old_long_display[time_index..-1] if index
# Code review
#
# This seems really verbose...seems that there should be a simpler way to conditionally set
# the value of a variable. I would like to write something like:
# body = post.get_formatted_body || ""
#
# That fails when the post is nil. This helper has to deal with a nil post object being passed in
# so I added the .nil? check. This is a contrived version of the situation I have, so don't
# nitpick the details.
#
This is a simple sinatra feedburner proxy. This technique can be used for getting around firewalls and things of that nature.
To use it, you can just `ruby feedburner_proxy.rb` at the cli and then navigate to `http://localhost:4567/FEED_URL`.
e.g. `http://localhost:4567/expectedbehavior` or `http://localhost:4567/jqr`, which will then pull down
'http://feeds2.feedburner.com/expectedbehavior' and 'http://feeds2.feedburner.com/jqr', respectively.
You can check it out at: http://high-spring-46.heroku.com