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
# | |
# 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
@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
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
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
class GetLastFmFeed | |
def self.displayFeed | |
require 'rss' | |
require 'open-uri' | |
@lastfmArray = [] | |
rss = RSS::Parser.parse open('http://ws.audioscrobbler.com/1.0/user/minasmir/recenttracks.rss').read, false | |
puts rss.channel.title |
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
class Pizza | |
def initialize(&factory) | |
@factory = factory | |
end | |
def bake | |
@factory.call | |
end | |
end |
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
<?php | |
require_once('includes/db.inc.php'); | |
$results = mysql_query('SELECT ID, Alere_PID FROM qcl.alere'); | |
while($row = mysql_fetch_assoc($results)){ | |
$current_pid = $row['Alere_PID']; | |
$pid_results = mysql_query("SELECT Question, Answer FROM qcl.alere_results WHERE PID = '$current_pid'"); | |
while($pid_row = mysql_fetch_row($pid_results)){ | |
$question = $pid_row[0]; |
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
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'nokogiri' | |
puts 'parsing xml file' | |
parsed = Nokogiri::XML(open("./wordpress.2010-10-06.xml")) | |
puts 'pulling titles' | |
i = 0 |
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
<?php | |
function bcrypt($password, $salt) | |
{ | |
//Checks to see if blowfish is installed on the server | |
CRYPT_BLOWFISH or die ('No Blowfish found.'); | |
$password = $password; | |
$salt = $salt; | |
//This sets up the Blowfish prefix and end | |
$Blowfish_Pre = '$2a$05$'; //this instructs blowfish to encrypt 5 passes |