Skip to content

Instantly share code, notes, and snippets.

View zeroeth's full-sized avatar
🤖
🐱 🤖 🐱 🤖

[0] zeroeth

🤖
🐱 🤖 🐱 🤖
View GitHub Profile
@zeroeth
zeroeth / bmi.py
Created January 1, 2011 17:11
bmi calculator
### 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)
@zeroeth
zeroeth / sentinel01.py
Created January 2, 2011 23:07
a two input primed sentinel loop
# 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
def count_frequency(word_list)
counts = Hash.new(0)
for word in word_list
counts[word] += 1
end
counts
end
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
@zeroeth
zeroeth / gist:783821
Created January 18, 2011 01:00
a hex flower with some tango palette love
<?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">
number = -6.0/0.0
=> -Infinity
number.nan?
=> false
number.infinite?
=> -1
number.finite?
=> false
number = 0.0/0.0
=> NaN
number.finite?
=> false
number.nan?
=> true
number.infinite?
=> nil
infinity = 1.0/0.0
=> Infinity
123456789 < infinity
=> true
var internets = {
a: "short key data",
beets: "long key data"
}
// into!
var internets = {
a: "short key data",
beets: "long key data"
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|