Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
VOWELS = "AEIOUYÅÄÖ"
CONSONANTS = ('A'..'Z').reject { |char| VOWELS.include? char }
def consonant? char
CONSONANTS.include? char or CONSONANTS.include? char.upcase
end
def rovarspraket string
import random
def sample(items):
# the first argument can be omitted as it defaults to 0
randomIndex = random.randrange(len(items))
return items[randomIndex]
def promptForGender():
genderList = ["male", "female"]
@johnzeringue
johnzeringue / matches.py
Last active August 29, 2015 14:02 — forked from fmasanori/jogos.py
import requests
for match in requests.get('http://worldcup.sfg.io/matches').json():
if match['status'] == 'completed':
print('{home[code]} {home[goals]}, {away[code]} {away[goals]}' \
.format(home=match['home_team'], away=match['away_team']))