This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rss' | |
require 'open-uri' | |
@contentArray = [] | |
rss = RSS::Parser.parse open('http://weatheredwatcher.posterous.com/rss.xml').read, false | |
puts rss.channel.title | |
rss.items.each_with_index do |item,i| | |
puts "" if i.zero? or item.date.day != rss.items[i-1].date.day |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Car(make, model, carColor){ | |
this.make = make; | |
this.model = model; | |
this.carColor = carColor; | |
alert("Smell That New Car Smell!"); | |
} | |
Car.prototype.make = 'Car Make'; | |
Car.prototype.model = 'Car Model'; | |
Car.prototype.carColor = 'Car Color'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@contentsArray=[] #first we initialize an array for the contents | |
@fileArray =[] #then we initialize an array for the files | |
Dir.foreach("#{RAILS_ROOT}/public/posts") do |fname| | |
next if fname == '.' or fname == '..' | |
@fileArray.push fname | |
end | |
@fileArray = @fileArray.reverse #this insures that the blogs entries are listed in descending order | |
@fileArray.each{|file| | |
f = File.open("#{RAILS_ROOT}/public/posts/" + file, 'r') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Basic Ruby script to create a new project for basic web development | |
# | |
# Author: David Duggins | |
# Email: [email protected] | |
# | |
# Created: 5/4/2010 | |
# License: GPL2 | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Question(questionType, questionText, questionChoices, questionAnswers, answers){ | |
this.questionType = questionType; | |
this.questionText = questionText; | |
this.questionChoices = questionChoices.split("|"); | |
this.questionAnswers = questionAnswers.split(","); | |
this.answers = answers; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" | |
"http://www.w3.org/TR/html4/strict.dtd" > | |
<html lang = "en" > | |
<head> | |
<meta http - equiv = "Content-Type"content = "text/html; charset=utf-8" > | |
<title > Collatz Conjecture </title> | |
<meta name="generator" content="TextMate http:/ / macromates.com / "> | |
<meta name="author " content="weatheredwatcher "> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n = prompt("Enter a number greater than 1: "); | |
var counter = 0 | |
function collatz(n, counter) { | |
document.display.myCounter.value=counter; | |
if (n>1) { | |
if (n%2) { | |
t = 3 * n + 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function myErrorHandler($errno, $errstr, $errfile, $errline) | |
{ | |
$myLog = new Log; | |
$myLog->set_page($_SERVER['PHP_SELF']); | |
switch ($errno) { | |
case E_USER_ERROR: | |
$myLog->set_log("ERROR:[$errno] Fatal error on line $errline "); | |
$myLog->write_log(); | |
exit(1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function myErrorHandler($errno, $errstr, $errfile, $errline) | |
{ | |
switch ($errno) { | |
case E_USER_ERROR: | |
//here is what you display (or do) for a user error | |
exit(1); | |
break; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File.open("email_lists", 'w') {|file| | |
101.upto(161) { |i| | |
file.puts "client" + i.to_s + "@domain.com" | |
}} |