Skip to content

Instantly share code, notes, and snippets.

Ruslan ruslanpa

  • Kyiv, Ukraine
Block or report user

Report or block ruslanpa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View datatables test
$(document).ready(function() {
var url = "/ajax/objects.txt";
var table = $('#example').DataTable( {
"ajax": {
//url: "/ajax/objects.txt"
},
data : [],
"columns": [
{ "data": "name" },
{ "data": "position" },
@ruslanpa
ruslanpa / test.rb
Last active Aug 29, 2015
Looks like magic :)
View test.rb
class User
attr_accessor :name, :age
def initialize(name)
@name = name
end
def say_hello()
puts "Hello from #{@name}"
yield if block_given?
@ruslanpa
ruslanpa / mangareader.rb
Last active Mar 6, 2016
Simple download manager for mangareader.net
View mangareader.rb
require 'open-uri'
require 'nokogiri'
module Mangareader
module_function
BASE_URL = "http://mangareader.net"
# Example:
# => Mangareader.download "bleach", 552
View deaf_grandma.rb
# 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!'
View user.rb
class User
attr_accessor :name, :surname
def initialize(name, surname)
@name, @surname = name, surname
end
def full_name
"#{name} #{surname}"
end
You can’t perform that action at this time.