Skip to content

Instantly share code, notes, and snippets.

View mrchrisadams's full-sized avatar

Chris Adams mrchrisadams

View GitHub Profile
== AddAttachmentsPhotoToContent: migrating ===================================
-- add_column(:contents, :photo_file_name, :string)
rake aborted!
An error has occurred, all later migrations canceled:
Mysql::Error: Duplicate column name 'photo_file_name': ALTER TABLE `contents` ADD `photo_file_name` varchar(255)
@doc = open(RAILS_ROOT + "/spec/fixtures/feeds/" + "doc_.xml")
@doc_array = (@doc/:place) each do |item|
title = (item/:placeName).inner_html.strip
description = (item/:teaser).inner_html.strip
image = (item/:image/:URL).inner_html.strip
end
@sawdays_places.image = (place/:image/:URL).inner_html.strip
def list
unless read_fragment({})
@post = Post.find(:all, :order => 'created_on desc', :limit => 10) %>
end
end
def yql_name_hpricot(name)
# this method takes a place name, and returns the English name of the region it resides in.
# So 'Marnee La Valle Chessy' becomes 'Chessy', and 'London Kings Cross International' becomes 'London', and so on
require 'hpricot'
require 'open-uri'
# Use CGI library to escape out strange characters, which choke up Geoplanet
url_safe_name = CGI::escape(name)
<div id="contact_form">
<form method="post" action="php/sendmail.php">
<fieldset>
<legend>Name</legend>
<div class="form_line">
<label>First Name</label> <input type="text" name="firstname" value="" id="first_name" />
</div>
<div class="form_line">
undefined method `to_iso' for "Paris":String
Extracted source (around line #63):
60: <li><strong>Via:</strong></li>
61: <% result.connection.legs.each do |leg| %>
62: <%# Only return the first word of each name for now %>
63: <li class="stops"><%= leg.end_station.name.split(" ")[0].to_iso() %></li>
64: <% end %>
65: </ul>
<html>
<body> - textured background
<div> - illustrated backgroun
<!-- all the other stuff -->
</div>
[gitosis]
[group gitosis-admin]
writable = gitosis-admin
members = [email protected] @stemcels
[group team]
writable = testproject
members = @stemcels
example embeddable gist
//////////////////////////////////////////////////////////////////////////
// Tea Light source code, largely cut and pasted from existing code on //
// the web //
// //
// The majority of this code is based on XTalker/Bob.S's code on the //
// arudino forums: //
// http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1231812230 //
// //
// String parsing C code from JeffTanner: //
// http://www.daniweb.com/forums/showthread.php?p=640773 //