This file contains 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 | |
wp_reset_postdata(); | |
if(comments_open( ) || have_comments()) : ?> | |
<div class="comments-area"> | |
<?php if ( post_password_required() ) : ?> | |
<p><?php _e( 'This post is password protected. Enter the password to view any comments ', 'zeon' ); ?></p> | |
</div> | |
<?php | |
/* Stop the rest of comments.php from being processed, |
This file contains 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
#ruby 2.2.1p85 (2015-02-26 revision 49769) | |
#energies files must contain time on left column, energy on right, separated by space | |
#change paths on line 73 | |
energies = Dir.glob('*energies.txt') | |
energies = energies.pop | |
text = File.open(energies).read | |
text = text.to_s | |
array = text.split("\n") |
This file contains 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/perl | |
use strict; | |
use warnings; | |
#Prints out the name in a "sanitized" form of "First M. Last"; that is, first name, space, middle initial, period, space, last name. | |
#If there is no middle name, prints the letter X with no period following it. | |
#If there are multiple middle names, uses the initial of the first one. | |
my $name = "Melanie Aurelia Shebel"; |
This file contains 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
puts "How many Fibonacci numbers would you like?" | |
n = gets.to_i | |
puts "Awesome! I'll get started on that right away!" | |
def fibonacci(n) | |
array = [] | |
a,b = 0,1 | |
n.times do | |
array << a | |
a,b = b,a+b | |
end |
This file contains 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
if rocks > pebbles | |
puts "You have more rocks than pebbles." | |
elsif rocks < pebbles | |
puts "You have more pebbles than rocks." | |
end | |
if rocks > pebbles | |
puts "You have more rocks than pebbles." | |
elsif pebbles > rocks | |
puts "You have more pebbles than rocks." |
This file contains 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
puts "Enter a starting number for your range" | |
range_begin = gets.chomp.to_i | |
puts "Enter the ending number for your range" | |
range_end = gets.chomp.to_i | |
range = (range_begin..range_end) | |
dirty_prime_list = [] | |
range.each do |x| | |
euler = x**2 + x + 41 |
This file contains 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
unsorted_array = [5, 2, 8, 0, 9, 3, 1] | |
sorted_array = [] | |
count = 0 | |
while sorted_array.count != unsorted_array.count | |
unsorted_array.each do |i| | |
if i == count | |
sorted_array << i | |
end | |
end |
This file contains 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
puts "Pick a number 1-50" | |
number = gets | |
if number.include? "." | |
puts "I'm getting rid of that decimal. That was a dumb move." | |
end | |
number = number.chomp.to_i | |
while number < 1 || number > 50 |
This file contains 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
motion = "" | |
while motion != "off" | |
puts | |
puts | |
puts | |
puts " STOP" | |
puts " FORWARD" | |
puts "Left Speed......Left..........................Right.......Right speed" | |
puts |
This file contains 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
#This is just a gist because I felt like writing something | |
#and don't have Ruby installed on the computer I'm using | |
puts "What is the x value for the first point?" | |
x1 = gets | |
puts "What is the y value for the first point?" | |
y1 = gets | |
puts "What is the x value for the second point?" |