Archive for the ‘ Programing ’ Category

Clisp Snippets

I’ve been playing around with the Land of Lisp, which is an awesome book written for Common Lisp, Gnu Clisp to be specific. So, I like vim, and I like SnipMate, but SnipMate doesn’t ship with any lisp snippets, and I couldn’t find any on github, so I wrote my own, albeit incomplete, set. You can find it here, and it is designed to work with Pathogen.

Advertisements

List

In my quest to provide something everybody already has, I present to you List, a simple Linked List implementation in Ruby. You can get it here, if you really want to. This is my first experiment in test driven development, and it definitely produced many more tests than any other code I’ve written. We’re talking 8 tests for 2 classes, some 13 or 14 tests. It worked pretty well, but I don’t know if I’ll do it again. Maybe I won’t need to.

Obscuring Information in Function Calls

While the usefulness of this is questionable, it is possible to obscure valid information in a bogus function call. Check out the following code:

class Example
	def new(*args)
		puts "Got data: " + args[1] if method_name == :new
	end
end

You can then write the following code:

Example.new("127.0.0.1", 1342)

And it should print out “127.0.0.1”. What’s more, the actual call looks like an internet connection, not something that might print something. Again, the usefulness of this is questionably, but it could be useful.

Announcing BerryConf

I am pleased to announce BerryConf!

BerryConf is a simple but easy to use Java library for parsing and managing configuration files! It’s still in beta, but it works well, and I’m using a very similar system in one of my latest projects, which I can’t say a whole lot about, but It is looking quite cool. So anyway, check out BerryConf if you’re looking for such a library.

Deady and irc bots.

I recently got involved in the creation of irc bots. It is common knowledge that my language of choice is ruby, so I set about making a bot in ruby. None of my friends had used ruby, they had used perl and PHP. I got an IRC library, and improved it, adding support for joining channels after the MOTD, a problem which was afflicting my bot (it wouldn’t always join the channels) an added support of auto-joining mutliple channels. I am currently working on a weapons system and dice bag. I then forked the project, and created Deady, a hellish irc bot. Deady is just like my other IRC bot, only Deady is contained in a single file, which you can download here. Deady utilzes ruby’s random number generator to generate a random name. It then joins the specified channels, and sits, doing nothing. However, if somebody says:
botsnack

Deady will say: botsnack, starting a vicious cycle where each deady will say botsnack, causing the other one to say botsnack, and causing all the other bots in the channel to respond with thier proper botsnack response (typicaly “:D.”) Though it has not been tested in a real world enviroment, I trust it works well. You can visit my nice bot, RBHellfire, on #bots on irc.foonetic.net. He doesn’t do much yet.

-Indigo

YstSimRB

Got a new programing project on github: YstSimRB Please provide positive criticism. No negative, please.

RubyCrypt Update

RubyCrypt Update! I am currently working on a new version, 1.2, and it may have a new feature, support for STDIN!. maybe. Still working on it.