Skip to content

Instantly share code, notes, and snippets.

View nuke99's full-sized avatar
🎯
Focusing

Treasure Jayasinghe nuke99

🎯
Focusing
View GitHub Profile
#!/usr/bin/env ruby
require 'optparse'
options = {}
$name = nil
$age = nil
optparse = OptionParser.new do|opts|
opts.on( '-h', '--help', 'Display this screen' ) do
puts opts
exit
#!/usr/bin/ruby
require "readline"
while cmd = Readline.readline(("line ")+"> ", true)
puts cmd
method, commands,para = cmd.split
if method
if respond_to?(method)
parameter_count = method(method.to_sym).arity
puts parameter_count
if parameter_count == 1
#!/usr/bin/ruby
require 'readline'
class Commands
def banner
puts 'This is a banner.'
end
def loka
#!/usr/bin/ruby
require 'readline'
require './lib/trollop'
class Commands
def banner
puts 'This is a banner.'
end
def name
#!/usr/bin/ruby
require 'net/http'
module Request
def req_get(url)
uri = URI(url)
Net::HTTP.start(uri.host, uri.port) do |http|
request = Net::HTTP::Get.new uri.request_uri
#!/usr/bin/ruby
selected = 2 # this can be changed anytime . the second of null changed to 2nd beause of this variable
total = 10 #total nulls
word = ",null"
count= word * (total-1)
puts "somesite.com/?id=1 null#{count}--"
#I want the output as
# somesite.com/?id=1 null,2nd,null,null,null,null,null,null,null,null--
#!/usr/bin/ruby
def look
puts "this is somthing else to look at but should be end in here "
#exit --- I dont want to put a exit here :( help
end
(1..10).each do |e|
puts e
if e == 5
print "somthing"
#!/usr/bin/ruby
require 'rubygems'
require './lib/trollop'
opts = Trollop::options do
version "test 1.1 "
banner <<-EOS
This is a sample banner for my test script
EOS
#!/usr/bin/ruby
require 'rubygems'
require './lib/trollop'
opts = Trollop::options do
version "test 1.1 "
banner <<-EOS
This is a sample banner for my test script
EOS
#!/usr/bin/ruby
require 'rubygems'
require './lib/trollop'
opts = Trollop::options do
version "test 1.1 "
banner <<-EOS
This is a sample banner for my test script
EOS