Skip to content

Instantly share code, notes, and snippets.

Building the next thing

Shane Becker veganstraightedge

Building the next thing
Block or report user

Report or block veganstraightedge

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
veganstraightedge / zine.rb
Created Aug 19, 2009
My first rails (1.1.6) model
View zine.rb
class Zine < ActiveRecord::Base
validates_presence_of :title, :downloads
has_many :tag
def self.latest
:select => "id",
:order => "id DESC")
veganstraightedge / gist:172498
Created Aug 21, 2009
Rotating text with CSS Transform does not change the layout. Ideas?
View gist:172498
<!DOCTYPE html>
<style type="text/css" media="screen">
table { margin-top: 300px; }
th { background: #eee; }
th span {
View gist:322270
<!--[if !IE]><!-->
<h1>You are NOT using Internet Explorer</h1>
View gist:344197
def flash_video_tag(css_id, file_url, size="640x480", options={})
if options[:autostart]
autostart = "true"
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}"
View gist:378119
class PlantsController < ApplicationController
respond_to :html, :json, :xml, :csv, :yaml, :txt
def index
if params[:q]
@plants =[:q]).paginate(:page => params[:page], :per_page => 50)
@plants = Plant.paginate(:page => params[:page], :per_page => 50)
respond_with @plants
View iPad-and-iPhone-specific-and-orientation-specific-stylesheets.css
<!-- 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" />
View gist:421959
require "date"
require "time"
# converts base10 integers into NewBase60
def num_to_sxg(num=nil)
sxg = ""
vocabulary = "0123456789ABCDEFGHJKLMNPQRSTUVWXYZ_abcdefghijkmnopqrstuvwxyz"
return 0 if num.nil? ||
View gist:480679
View gist:614198
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'
View gist:649972
defaults write com.macromates.textmate OakDefaultLanguage E00B62AC-6B1C-11D9-9B1F-000D93589AF6
You can’t perform that action at this time.