Skip to content

Instantly share code, notes, and snippets.

View jcasimir's full-sized avatar

Jeff Casimir jcasimir

View GitHub Profile
class PlacePage < Page
description "A page to display a single Place"
def find_by_url(url, live = true, clean = false)
url = clean_url(url) if clean
if Place.parse_url(url)
Page.find_by_title("single-place-template")
else
super
end
module PlacesTags
include Radiant::Taggable
include PlacesHelper
tag 'place' do |tag|
tag.locals.place = Place.find_by_url(@request.request_uri) if tag.locals.place.nil?
tag.expand
end
desc 'Finds all places'

Photos are here:

http://www.flickr.com/photos/jcasimir/sets/72157624443205261/

Currently Available for $5 each:

Programming Ruby – Dave Thomas
The Ruby Way Second Edition – Hal Fulton
Rails Recipes – Chad Fowler
The Ruport Book – Your Guide to mastering Ruby Reports – Gregory Brown & Michael Milner

@jcasimir
jcasimir / gist:652681
Created October 29, 2010 01:06
Gemfile
source :rubygems
gem "radiant", "0.9.1"
gem "sqlite3-ruby", "1.3.1", :require => "sqlite3"
gem 'will_paginate', '2.3.14'
gem 'rmagick', '2.13.1'
gem 'formtastic', '1.0.0'
gem 'fastercsv', '1.5.3'
gem 'authlogic', '2.1.6'
gem 'gravtastic', '2.2.0'
gem 'sanitize', '1.2.1'
# Don't change this file!
# Configure your app in config/environment.rb and config/environments/*.rb
RAILS_ROOT = File.expand_path("#{File.dirname(__FILE__)}/..") unless defined?(RAILS_ROOT)
require 'rubygems'
require 'bundler'
begin
# Set up load paths for all bundled gems
ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", __FILE__)
Hi,
Please take a look at the following Twitter user and decided if I should "follow" them. Here are the criteria:
#1) Do they seem to be a real person? (Not a bot, spammer, etc)
#2) Are they a technology person (ex: description includes things like "ruby", "rails", "programmer", "UI", "UX", etc)
#3) Of their last 6 tweets is at least one original writing? (Not just "retweets")
#4) Of their last three or so original tweets, are a majority of them positive/commentary? (If they're negative/complaining, don't follow!)
If all four of those are satisfied, please follow them with both of my accounts.
require 'rubygems'
require 'oauth'
require 'twitter'
require 'launchy'
class JSTwitter
attr_accessor :client
@@credentials = {
:consumer_key => "FNjrMrTdkUhadFGeHIVKTg",
:consumer_secret => "AB17hKWAlKE0rmi3kJeScrNd1Msq588niP8jtlBpA"
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
<style>.highlighted{border: 2px solid red;}</style>
</head>
<body>
<div id='seating_chart'>
<ul id='first_class'>
<li id='row_1'>
<ul>
<li class='premium a'></li>
class Student < ActiveRecord::Base
def initialize(params)
self.lunch = LunchTracker.new
self.lunch_balance = LunchTracker::STARTING_BALANCE
super(params)
end
end
# Refactoring one step further to take out the knowledge of Lunch's exact class name...
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
<style>.highlighted{border: 2px solid red;}</style>
</head>
<body>
<h1 class="heading safety">Safety Information</h1>
<p id="intro instructions">
The information below is <span class='important'>critical to survival</span> and you must read it right now. <em>Twice</em>.
</p>