Skip to content

Instantly share code, notes, and snippets.

View byronmejia's full-sized avatar
🛒
🖨🖨🖨🖨🖨

Byron Mejia byronmejia

🛒
🖨🖨🖨🖨🖨
View GitHub Profile
# Write a program that prints the numbers from 1 to 100. But for multiples of
# three print “Fizz” instead of the number and for the multiples of five print
# “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.
def fizzbuzz x
fizz = (x % 3) == 0 ? 'fizz' : ''
buzz = (x % 5) == 0 ? 'buzz' : ''
unless "#{fizz}#{buzz}" == ''
puts "#{fizz}#{buzz}"
else
#include <iostream>
using namespace std;
int fizzBuzz(int x) {
if((x % 3) == 0) cout << "fizz";
if((x % 5) == 0) cout << "buzz";
if(( (x % 3) && (x % 5) ) != 0) cout << x;
#include <stdio.h>
int main() {
for(int i = 0; i <= 100; i++)
(i % 15) == 0 ? printf("FizzBuzz\n"):
(i % 3) == 0 ? printf("Fizz\n"):
(i % 5) == 0 ? printf("Buzz\n"):
printf("%i\n", i);
return 0;
}
X = 0
Y = 0
Z = 0
C$ = " "
input "Enter first number: ", X
print "Input: ", X
input "Enter second number: ", Y
print "Input: ", Y
#include <stdio.h>
int main() {
double x = 0;
double y = 0;
double z = 0;
char c = ' ';
WHILE:
printf("Enter First Number: ");
// My quick hack to making a typing animation on screen, without silly JQuery...
// typeOut takes the:
// element: DOM element to manipulate
// string: string to type out
// delay: time between keystrokes
function typeOut (element, string, delay) {
for(var i = 0; i < string.length; i++){
(function(){
var tempI = i;
@byronmejia
byronmejia / pubsubtweet.rb
Created March 29, 2016 13:24
What if.. dreams...
require 'celluloid/autostart'
require 'twitter'
class TweetActor
include Celluloid
include Celluloid::Notifications
attr_reader :twitter_client
def initialize
now = Time.now.to_f
# Create an app that completes the following:
# - Leap Years
# - if x is divisible by 4, but not 100
def leap(number)
(((number % 4) == 0) && !((number % 100) == 0))
end
puts leap(4)
puts leap(100)
.center-hor {
position: absolute;
right: 50px;
left: 50px;
text-align: center;
}
.center-ver {
position: absolute;
top: 50%;
if (!kore_pgsql_query(&sql, "SELECT * FROM devices")) {
kore_pgsql_logerror(&sql);
goto out;
}