Posted by Nicholas
Thu, 10 Apr 2008 18:28:00 GMT
Recently I was given the task of integrating a (complete for all intents and purposes) PHP application with our main Ruby on Rails application. Because the PHP application needed to display a similar interface and required knowledge of the user’s account, I needed a way to access that data from the database both applications were now sharing. The only real requirement I had was that I absolutely didn’t want to make the user login to the PHP app if they were already authenticated on the Rails side of things as this seemed unnecessary and interrupted the flow things.
I did a bit of searching and, while I did find the wiki page on going from PHP -> Rails, I wasn’t able to find anything that fit my specific need, so I set out to roll my own. I read an article this morning from somebody who had ostensibly encountered the same problem as I, and was able to come up with a much different solution than what I had come up with. Therefore I thought it would be fun to share some of the details of my approach....
finish reading 'Persisting a user session from RoR->PHP'
Posted in php, tips, rails, ruby, code | no comments
Posted by Nicholas
Wed, 12 Dec 2007 19:22:00 GMT
Everyone loves writing web apps. They’re just amazing at doing everything. Ever.
One of the more interesting aspects of writing web applications is how often you see yourself doing the same thing over and over again....
finish reading 'Nothing or not'
Posted in rails, tips, code, ruby | no comments
Posted by Nicholas
Wed, 14 Feb 2007 18:30:17 GMT
More often than not I see sites that have a mailto link with an exposed email. This is setting yourself up to have your email harvested.
A quick and easy trick that you can use to hide emails from spiders is to replace the letters with html characters....
finish reading 'Hiding mailto links from spiders'
Posted in code, ruby, tips, spam | no comments
Posted by Nicholas
Mon, 29 Jan 2007 21:38:00 GMT
Today I got extremely sick of coming on to see many hundreds of emails in my inbox from spam bots. I know a few posts ago I mentioned that I would be looking out for a solution, and I did. Unfortunately I have the attention span of a 3 year old and I forgot what I was doing fairly quick.
Today I was doing my normal blog run and I stopped by the site of a friend and co worker Douglas F Shearer when I happened across this post on his blog. Toward the end of the post he makes a short mention about how he’s now using something called Akismet as a potential guard against spam....
finish reading 'Just say no to spam'
Posted in spam, rails, typo, ruby, code | no comments
Posted by Nicholas
Wed, 24 Jan 2007 23:46:00 GMT
Earlier today a friend of mind linked me to what has to be the most hilarious request ever made on one of those freelance coder for hire sites.
Just feast your eyes on this beautiful opportunity. Wouldn’t you just love to win the bid on that? 1-3 thousand dollars for an operating system is quite a fabulous chance to make some easy money quickly....
finish reading 'Need an OS written fast!!'
Posted in ridiculous, code | no comments
Posted by Nicholas
Tue, 26 Dec 2006 21:26:00 GMT
Today I was stuck with the unusually frustrating task of trying to get the ruby-odbc bridge to build on OpenBSD 3.8.
After a seemingly illogical amount of time spent fighting with extconf.rb, to recognize the ever ‘missing header files’ that could be found in /usr/local/include. These header files were sql.h, sqltypes.h, sqlext.h, odbcinst.h, and odbcinstext.h....
finish reading 'Building ruby-odbc on OpenBSD 3.8'
Posted in openbsd, code | no comments
Posted by Nicholas
Mon, 18 Dec 2006 02:31:00 GMT
As an old PHP hat I’ve missed the ability of being able to grab a random number out of a range ala PHP’s sweet rand() function. Sure it’s easy to create an alternative, but it’s just not as convenient. Today a friend of mine had a need to do just that. However there was a catch: He needed to pull a random number from a range, yet ignore a variable amount of numbers from that range.
The solution I came up with, which I figured may be of some use to somebody, was this:...
finish reading 'Random number from a range?'
Posted in typo, ruby, code | no comments
Posted by Nicholas
Sun, 22 Oct 2006 04:18:00 GMT
I have this little nugget of information that I discovered many months ago, but I’d always had a fairly easy time keeping it to myself as I wasn’t yet powering the internet with my blog.
However, now that I have a canvas with which to paint crap on, I figure now is as good a time as any to hip some fellow developers to a pretty useful and undocumented (or maybe everyone already knows what it is to the point that nothing needs to be said) feature of Ruby....
finish reading 'Returning data from a Ruby block'
Posted in rails, ruby, code | no comments
Posted by Nicholas
Fri, 20 Oct 2006 00:02:00 GMT
A very short time ago, when I was creating Pong for the games section, everything seemed to be going smooth. A little too smooth as it turned out. No more than a day later, a friend of mine was playing the game in IE6, and noticed that the ball was, for some bizarre reason, about 12px in height. At first I brushed it aside thinking he was simply messing around with me, until I got home that night and played the game in IE6. Sure enough, even though the height and width were hardset at 5px, the ball was 12 pixels tall.
I pulled my hair out for what seemed like an eternity trying to fix this ridiculous issue, and I’d nearly exhausted all possible options. Because of this, I decided to try setting what I thought would be a pretty stupid idea, and set font-size: xx-small. As if by magic the div height was reduced, and all was well....
finish reading 'min-height in IE6?'
Posted in css, code | 1 comment