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
$(document).ready(function() { | |
var url = "/ajax/objects.txt"; | |
var table = $('#example').DataTable( { | |
"ajax": { | |
//url: "/ajax/objects.txt" | |
}, | |
data : [], | |
"columns": [ | |
{ "data": "name" }, | |
{ "data": "position" }, |
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
class User | |
attr_accessor :name, :age | |
def initialize(name) | |
@name = name | |
end | |
def say_hello() | |
puts "Hello from #{@name}" | |
yield if block_given? |
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
require 'open-uri' | |
require 'nokogiri' | |
module Mangareader | |
module_function | |
BASE_URL = "http://mangareader.net" | |
# Example: | |
# => Mangareader.download "bleach", 552 |
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
# Deaf Grandma | |
puts "Hey Sonny! It's your lovely Grandmother! How are you?" | |
while (response = gets.chomp) != 'BYE' | |
puts "Huh?! I CAN'T HEAR YOU!" if response != response.upcase | |
puts 'NO! NOT SINCE 19' << (rand(30..50)).to_s if response == response.upcase | |
end | |
puts 'GOOD BYE, SONNY!' |
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
class User | |
attr_accessor :name, :surname | |
def initialize(name, surname) | |
@name, @surname = name, surname | |
end | |
def full_name | |
"#{name} #{surname}" | |
end |