Skip to content

Instantly share code, notes, and snippets.

View wfarr's full-sized avatar
:shipit:
shipping

Will Farrington wfarr

:shipit:
shipping
View GitHub Profile
class PostsController < ApplicationController
...
# Displays posts that contain any of one or more tags passed in
# GET /posts/tag/:tag1,:tag2,... || GET /posts/tag/:tag
def tag
@tag = params[:tag]
@tag = @tag.split(",") if @tag =~ /,/
@posts = Post.all(:conditions => { :tags => @tag }, :order => 'created_at desc' )
respond_to do |format|
class PostsController < ApplicationController
def tag
# Will return a list of items matching one or any tags passed to the controller, sorted, without duplicates
@tag = params[:tag]
@tag = @tag.split(",") if @tag =~ /,/
@posts = Post.all(:conditions => { :tags => @tag }, :order => 'created_at desc' )
...
end
end
wfarr@Will-Farringtons-Macbook:~/Code/wfarr.github.com[redesign*]$ sudo gem install RedCloth mojombo-jekyll
Building native extensions. This could take a while...
Successfully installed RedCloth-4.2.2
Successfully installed mojombo-jekyll-0.5.2
2 gems installed
Installing ri documentation for RedCloth-4.2.2...
Installing ri documentation for mojombo-jekyll-0.5.2...
Updating ri class cache with 2549 classes...
Installing RDoc documentation for RedCloth-4.2.2...
Installing RDoc documentation for mojombo-jekyll-0.5.2...
Safari = From
Firefox 3.5 RC 1 = To
TEST COMPARISON FROM TO DETAILS
=============================================================================
** TOTAL **: *2.35x as slow* 599.0ms +/- 3.8% 1410.4ms +/- 1.2% significant
=============================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.apple.things-growl</string>
<key>ProgramArguments</key>
<array>
<string>osascript</string>
<string>/Users/wfarr/Library/Scripts/Applications/Things/Display ToDo's in Growl.scpt</string>
Updating installed gems
Updating RedCloth
Building native extensions. This could take a while...
ERROR: Error installing RedCloth:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
can't find header files for ruby.
-- register Things for growl notices
tell application "GrowlHelperApp" to register as application "Things" all notifications {"ToDo Notice"} default notifications {"ToDo Notice"}
tell application "Things"
-- get items in the today list
repeat with todo in to dos of list "Today"
-- growl only open itesm
if status of todo is open then
if notes of todo is not missing value then
-- get the notes
@wfarr
wfarr / ruby.el
Created April 29, 2009 18:33
Highlight operators in ruby-mode
(add-hook 'ruby-mode-hook
(lambda ()
(font-lock-add-keywords
'ruby-mode
'(("\\([-,\\.\\+\\*/%&|\\^~=<>:]\\)" . font-lock-keyword-face)))))
=clean-list
ul
:list-style-type none
:margin-left -2em
:line-height 2em
li
:font-size 1em
:margin-bottom 0.4em
=clean-list-left
//
//
//
//
//
//
//
//
//
//