Skip to content

Instantly share code, notes, and snippets.

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

Byron Mejia byronmejia

🛒
🖨🖨🖨🖨🖨
View GitHub Profile
@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
// 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;
#include <stdio.h>
int main() {
double x = 0;
double y = 0;
double z = 0;
char c = ' ';
WHILE:
printf("Enter First Number: ");
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() {
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;
}
#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;
# 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