This file contains 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
# irb... | |
# Numbers | |
3 + 2 | |
# Strings | |
puts "Hi, everybody!" | |
# Booleans | |
true | |
false |
This file contains 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
In Ruby, your information (or data) can come in different types. | |
Let's learn about three to start: numbers, booleans, and strings. | |
Let's set a variable `my_num` to the value 25 | |
my_num = 25 | |
Let's set a variable `my_boolean` to the value true | |
my_boolean = true | |
Set `my_string` to "Ruby" |
This file contains 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 :: Int -> Int -> Int | |
x other = (* other) | |
main = (putStrLn . show) (9 `x` 9) | |
-- 81 |
This file contains 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
#lang racket | |
(define min 0) | |
(define max 100000000) | |
(define (recursive-function n) | |
(if (>= n max) | |
n | |
(recursive-function (+ n 1)))) |
This file contains 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 Ten Favorite Books I Read in 2014 | |
Quiet: The Power of Introverts in a World That Can't Stop Talking - Susan Cain | |
My Brilliant Friend (Honorable mention: The Days of Abandonment) - Elena Ferrante | |
i will never be beautiful enough to make us beautiful together - Mira Gonzalez | |
How Should a Person Be? - Sheila Heti | |
My Struggle: Book 1 (Honorable mentions: Book 2, Book 3)- Karl Ove Knausgaard | |
Preparation For The Next Life - Atticus Lish | |
Crapalachia - Scott McClanahan | |
Citizen: An American Lyric - Claudia Rankine |
This file contains 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
fizz_word = fn | |
0, 0, _ -> "FizzBuzz" | |
0, _, _ -> "Fizz" | |
_, 0, _ -> "Buz" | |
_, _, x -> x | |
end | |
fizz_buzz = fn n -> fizz_word.(rem(n, 3), rem(n, 5), n) end | |
Enum.each 1..100, fn(n) -> IO.puts(fizz_buzz.(n)) end |
This file contains 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
import <Foundation/CPObject.j> | |
@implementation AppController : CPObject | |
{ | |
CPTextField label; | |
} | |
- (void)applicationDidFinishLaunching:(CPNotification)aNotification | |
{ |
This file contains 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
#ALL HAILZ THE TRV DVRK EMPORER | |
#THEBIRDCAGETHEATER | |
require 'ruby-processing' | |
require 'boids' | |
class HailHail < Processing::App | |
attr_reader :blackout | |
# And what shall He look like? |
This file contains 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
#IRB Funone | |
def hacked_computer | |
(1000 * 100).times do | |
puts "Preparing hard drive for reformat" | |
end | |
end | |
def ruin_computer | |
(1000 * 100).times do |
This file contains 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
for i in 1..100;if i%15==0;print"FizzBuzz";elsif i%5==0;print"Buzz";elsif i%3==0;print"Fizz";else;print i;end;print "\n";end |
OlderNewer