Skip to content

Instantly share code, notes, and snippets.

View robermorales's full-sized avatar

Rober Morales-Chaparro robermorales

View GitHub Profile
#!/usr/bin/env ruby
class Array
def flat
inject [] do |memo, current|
if current.kind_of? Array
memo += current.flat
else
memo << current
end
public class Calculator {
public static String[][] values = {
{ "CM", "DCD" },
{ "M", "DD" },
{ "CD", "CCCC" },
{ "D", "CCCCC" },
{ "XC", "LXL" },
<html><head><!-- emp: 19 de junio -->
<title>ConeCta CuaTro, por Roberto Morales </title>
<style>
.c4{background:#000000}
h1{background:black;border-bottom:3px ridge red;margin:0;padding:0;font-style:normal; font-variant:normal; font-weight:normal; font-size:40px}
h4{background:black;border-bottom:3px ridge red;padding:0;font-style:normal; font-variant:normal; font-weight:normal; font-size:20px; margin-left:0; margin-right:0; margin-top:0; margin-bottom:10}
a{cursor:hand;text-decoration:none;color:lime}
a:hover{background:#11aa11;cursor:hand}
td{font-size:16px;font weight:bold}</style>
<script lang="JavaScript">
<html><head><!-- emp: 19 de junio -->
<title>ConeCta CuaTro, por Roberto Morales </title>
<style>
.c4{background:#000000}
h1{background:black;border-bottom:3px ridge red;margin:0;padding:0;font-style:normal; font-variant:normal; font-weight:normal; font-size:40px}
h4{background:black;border-bottom:3px ridge red;padding:0;font-style:normal; font-variant:normal; font-weight:normal; font-size:20px; margin-left:0; margin-right:0; margin-top:0; margin-bottom:10}
a{cursor:hand;text-decoration:none;color:lime}
a:hover{background:#11aa11;cursor:hand}
td{font-size:16px;font weight:bold}</style>
<script lang="JavaScript">
@robermorales
robermorales / fizzbuzz.rb
Created March 4, 2012 23:13
FizzBuzz implementation
# 25 de feb 2012
def fizzbuzz_value ( input )
o = ''
o += 'fizz' if( input % 3 == 0 )
o += 'buzz' if( input % 5 == 0 )
o = input.to_s if( o == '' )
o
end