This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'celluloid/autostart' | |
| require 'twitter' | |
| class TweetActor | |
| include Celluloid | |
| include Celluloid::Notifications | |
| attr_reader :twitter_client | |
| def initialize | |
| now = Time.now.to_f |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| int main() { | |
| double x = 0; | |
| double y = 0; | |
| double z = 0; | |
| char c = ' '; | |
| WHILE: | |
| printf("Enter First Number: "); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| X = 0 | |
| Y = 0 | |
| Z = 0 | |
| C$ = " " | |
| input "Enter first number: ", X | |
| print "Input: ", X | |
| input "Enter second number: ", Y | |
| print "Input: ", Y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
NewerOlder