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 Permissions | |
1 2 3 | |
- --- --- --- | |
d rwx rwx rwx | |
r: Read | |
w: Write | |
x: Execute (execute file as a program, or execute directory meaning see contents of directory) | |
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
<script src="//embed.flowplayer.org/5.5.2/embed.min.js"> | |
<div class="flowplayer" style="width: 624px; height: 400px;"> | |
<video> | |
<source type="video/mp4" src="/data/mp4.mp4"> | |
</video> | |
</div> | |
</script> |
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 EmptyArrayError < StandardError | |
end | |
def avg(arr) | |
if arr.length == 0 | |
raise EmptyArrayError, "Average can only be called on arrays that have values." | |
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
# implement division without using multiplication or division operators. | |
# return the result and the remainder. | |
# this implementation uses addition for the sum | |
def divide(number, divisor) | |
count = 0 | |
sum = 0 | |
while sum <= (number - divisor) |
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
# implement division without using multiplication or division operators. | |
# return the result and the remainder. | |
# this implementation uses addition for the sum | |
def divide(number, divisor) | |
count = 0 | |
sum = 0 | |
while sum <= (number - divisor) |
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
<html> | |
<head> | |
<style> | |
body { background: #358; color: #fff; padding: 50px; font-family: sans-serif; } | |
</style> | |
</head> | |
<body> | |
<script> |
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
<html> | |
<head> | |
<style> | |
body { background: #358; color: #fff; padding: 50px; font-family: sans-serif; } | |
a { color: #fff; font-size: 40px; } | |
section { | |
width: 800px; | |
margin: 0px auto; | |
} |
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> | |
<head> | |
<title>hi</title> | |
<style> | |
body, html { | |
background: #aaa; | |
font-family: monospace; |
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> | |
<html> | |
<head> | |
<link rel="stylesheet" href="/style.css" /> | |
</head> | |
<body> | |
<% if @loggedin == true %> | |
welcome, <%=@username %> | |
<a href='/logout'>Log out</a> |
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
# find angle between clock hands | |
def angle(hour, minutes) | |
hour += (minutes / 60.0) | |
angle_hour = hour * 30 | |
angle_mins = minutes * 6 | |
(angle_hour - angle_mins).abs |