Skip to content

Instantly share code, notes, and snippets.

View veganstraightedge's full-sized avatar
🐢
Computers were a mistake.

Shane Becker veganstraightedge

🐢
Computers were a mistake.
View GitHub Profile
@veganstraightedge
veganstraightedge / zine.rb
Created August 19, 2009 04:08
My first rails (1.1.6) model
class Zine < ActiveRecord::Base
validates_presence_of :title, :downloads
has_many :tag
def self.latest
find(:first,
:select => "id",
:order => "id DESC")
end
@veganstraightedge
veganstraightedge / gist:172498
Created August 21, 2009 23:19
Rotating text with CSS Transform does not change the layout. Ideas?
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css" media="screen">
table { margin-top: 300px; }
th { background: #eee; }
th span {
<!--[if !IE]><!-->
<h1>You are NOT using Internet Explorer</h1>
<!--<![endif]-->
def flash_video_tag(css_id, file_url, size="640x480", options={})
if options[:autostart]
autostart = "true"
end
width, height = size.split("x")
player_url = "#{flash_video_host}players/player-licensed.swf"
player_args = "file=#{file_url}&amp;autostart=#{autostart}"
player_url_and_args = "#{player_url}?#{player_args}"
class PlantsController < ApplicationController
respond_to :html, :json, :xml, :csv, :yaml, :txt
def index
if params[:q]
@plants = Plant.search(params[:q]).paginate(:page => params[:page], :per_page => 50)
else
@plants = Plant.paginate(:page => params[:page], :per_page => 50)
end
respond_with @plants
<!-- iPad Goodies -->
<link media="only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation:landscape)" href="ipad-landscape.css" type="text/css" rel="stylesheet" />
<link media="only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation:portrait)" href="ipad-portrait.css" type="text/css" rel="stylesheet" />
<!-- End iPad -->
<!-- iPhone Goodies -->
<link media="only screen and (min-device-width: 320px) and (max-device-width: 480px) and (orientation:landscape)" href="iphone-landscape.css" type="text/css" rel="stylesheet" />
require "date"
require "time"
# converts base10 integers into NewBase60
def num_to_sxg(num=nil)
sxg = ""
vocabulary = "0123456789ABCDEFGHJKLMNPQRSTUVWXYZ_abcdefghijkmnopqrstuvwxyz"
return 0 if num.nil? || num.zero?
ooooooooopoill;;;;;;;;;;;;;;;;;;;;;;;;;;;;''''''''''''''''''''''''''''';;;;;;;;;;;;;/
test_login(LoginLogoutTest):
RuntimeError: Missing rack.input
facebooker (1.0.75) lib/facebooker/rails/facebook_url_rewriting.rb:42:in `can_safely_access_request_parameters?'
facebooker (1.0.75) lib/facebooker/rails/facebook_url_rewriting.rb:37:in `link_to_canvas?'
facebooker (1.0.75) lib/facebooker/rails/facebook_url_rewriting.rb:47:in `rewrite_url'
(eval):17:in `new_session_url'
/test/integration/login_logout_test.rb:8:in `test_login'
defaults write com.macromates.textmate OakDefaultLanguage E00B62AC-6B1C-11D9-9B1F-000D93589AF6