Skip to content

Instantly share code, notes, and snippets.

View weatheredwatcher's full-sized avatar
:octocat:
Working from home

David Duggins weatheredwatcher

:octocat:
Working from home
View GitHub Profile
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
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';
@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')
#
# Basic Ruby script to create a new project for basic web development
#
# Author: David Duggins
# Email: weatheredwatcher@gmail.com
#
# Created: 5/4/2010
# License: GPL2
#
function Question(questionType, questionText, questionChoices, questionAnswers, answers){
this.questionType = questionType;
this.questionText = questionText;
this.questionChoices = questionChoices.split("|");
this.questionAnswers = questionAnswers.split(",");
this.answers = answers;
}
<!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 ">
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;
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);
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;
File.open("email_lists", 'w') {|file|
101.upto(161) { |i|
file.puts "client" + i.to_s + "@domain.com"
}}