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
### INPUT | |
print "Enter height in feet and inches." | |
height_feet = int(raw_input("Feet: ")) | |
height_inches = int(raw_input("Inches: ")) | |
total_height_inches = (height_feet * 12) + height_inches | |
print "Total height is {} inches.".format(total_height_inches) |
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
# A Primed two input loop example | |
### INITIALIZE | |
total_cat_age = 0 | |
total_cat_weight = 0 | |
total_cats = 0 | |
print "Enter one or more cats age and weight and . to finish" | |
### LOOP PRIMER |
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
def count_frequency(word_list) | |
counts = Hash.new(0) | |
for word in word_list | |
counts[word] += 1 | |
end | |
counts | |
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
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
function ruby_symbol { | |
rvm-prompt u | |
} | |
function ruby_gemset { | |
rvm-prompt g |
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
<?xml version="1.0" standalone="no"?> | |
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" | |
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> | |
<svg height="600px" width="600px" viewBox="0 0 5.3 5.3" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> | |
<defs> | |
<g id="hexpetal" transform="rotate(90)"> | |
<polygon points="0.0,1.0 0.866025403784439,0.5 0.866025403784439,-0.5 1.22464679914735e-16,-1.0 -0.866025403784438,-0.5 -0.866025403784439,0.499999999999999"/> | |
</g> | |
</defs> | |
<style type="text/css"> |
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
number = -6.0/0.0 | |
=> -Infinity | |
number.nan? | |
=> false | |
number.infinite? | |
=> -1 | |
number.finite? | |
=> false |
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
number = 0.0/0.0 | |
=> NaN | |
number.finite? | |
=> false | |
number.nan? | |
=> true | |
number.infinite? | |
=> nil |
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
infinity = 1.0/0.0 | |
=> Infinity | |
123456789 < infinity | |
=> true |
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
var internets = { | |
a: "short key data", | |
beets: "long key data" | |
} | |
// into! | |
var internets = { | |
a: "short key data", | |
beets: "long key data" |
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
Scenario without magic | |
Given I don't use any spaces | |
When I type the table out | |
Then I should see the following mess: | |
|Latin|English| | |
|Cucumis sativus|Cucumber| | |
|Cucumis anguria|Burr Gherkin| |