Skip to content

Instantly share code, notes, and snippets.

# Since trying to rename my model from "decks" to "deck"
Routing Error
uninitialized constant User::DecksController
Try running rake routes for more information on available routes.
def translate(string)
x = string
if x.split.count > 1
new_array = x.split
new_array.each do |w|
if x[0].match(/[aeiou]/)
x = x + "ay"
elsif x[0] !~ (/[aeiou]/) && x[1] !~ (/[aeiou]/)
x[2..-1] + x[0..1] + "ay"
elsif x[0] !~ (/[aeiou]/)
def translate(string)
x = string
if x.split.count > 1
new_array = x.split
new_array.each do |w|
if x[0].match(/[aeiou]/)
x = x + "ay"
elsif x[0] !~ (/[aeiou]/) && x[1] !~ (/[aeiou]/)
x[2..-1] + x[0..1] + "ay"
elsif x[0] !~ (/[aeiou]/)
def translate(string)
x = string
if x.split.count > 1
new_array = x.split
new_array.each do |w|
w.to_s
if w[0].match(/[aeiou]/)
w = w + "ay"
elsif w[0] !~ (/[aeiou]/) && w[1] !~ (/[aeiou]/)
w[2..-1] + w[0..1] + "ay"
def translate(string)
x = string
vowels = (/[aeiou]/)
withq = (/[aeio]/)
splitskies = x.split
if x =~ (/[qu]/)
vowels = withq
end
if splitskies.size > 1
splitskies.map! do |w|
@camkidman
camkidman / index.html
Created September 18, 2013 16:25
Bootstrap Practice
<html>
<head>
<title>Practice</title>
<link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="screen">
</head>
<body>
<div class="container">
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
@camkidman
camkidman / pig_latin.rb
Created September 18, 2013 16:39
pig latin
def translate(string)
x = string
vowels = (/[aeiou]/)
withq = (/[aeio]/)
splitskies = x.split
if x =~ (/[qu]/)
vowels = withq
end
if splitskies.size > 1
splitskies.map! do |w|
@camkidman
camkidman / guess.sh
Last active December 23, 2015 18:49
#!/bin/bash
#guesssing game script
i=0
r=$[ ( $RANDOM % 100 ) + 1 ];
echo "Welcome to The Game of Guessing. Please enter a number between 1 and 100."
#Gather INPUT
read INPUT
#make iterations
def translate(string)
x = string
vowels = (/[aeiou]/)
withq = (/[aeio]/)
splitskies = x.split
if x =~ (/[qu]/)
vowels = withq
end
if splitskies.size > 1
splitskies.map! do |w|
// File Prolog
// Name: Cameron J Kidman
// CS 1400 Section 002
// Project: CS1400_Lab_20
// Date: 11/8/2013 0947
//
// I declare that the following code was written by me or provided
// by the instructor for this project. I understand that copying source
// code from any other source constitutes cheating, and that I will receive
// a zero on this project if I am found in violation of this policy.