swemoney.com

  • Random
  • Archive
  • RSS

Halo 3 Players now watches you in the shower..

Halo 3 Players is now watching you! I’ve added a History tab to Halo 3 Players on Facebook now! I’ll be saving an archive of all your old stats once a day (after you update your stats, of course) and you will be able to look at the progress you’ve been making over a variable number of days in several different stat types. You can see how your Kill-to-Death ratio has been improving (or not) or how many Killing Sprees per Game you we’re averaging 2 weeks ago compared to today! All the good stats are there, as well as my own true score (or best score, which ever you know it as) that combines your social and ranked stats (giving more weight and points to your ranked games, of course) and spits out a fancy overall score that you can compare against your friends to see who really is the best.

If you’ve been a fan of Halo 3 Players, this update should work great for you because I have been keeping track of gamertags for almost 2 months now (which means, if you’ve been using Halo 3 Players, you should have some information ready to graph on the History tab!). If you haven’t heard of Halo 3 Players or aren’t a member yet, what are you waiting for?! Show off your stats to all your friends! Scream from the roof tops how much you love Halo 3 by putting a profile tab on your Facebook page! Slap a box on your main profile for some more Halo 3 love! Compare your own stats against all your friends who are also using Halo 3 Players! There’s lots to go, so go do it! Why are you still reading this?

    • #facebook
    • #halo 3 players
    • #ruby on rails
    • #halo 3
    • #xbox
    • #My Stuff
  • 3 years ago
  • 2
  • Comments
  • Permalink
  • Share
    Tweet

Halo 3 Players 2.x


Halo 3 Players was updated a few weeks ago. Most of the initial bugs have been squashed with only 1 main feature still left to be finished. I’m working on Challenges now and they should be back very shortly. The new 2.x version is a complete rewrite of the old Halo 3 Players. Since Halo 3 Players has been my first ‘real’ project, I did learn quite a bit from it and was able to improve a lot of things in the new version. So besides the nicer look and extra features, it also works better behind the scenes (and is even a little more modular so I can improve stuff even more without breaking other things). If your a Halo 3 Player and have a Facebook account, you should definitely check it out! It blows the other 2 or 3 Halo 3 applications out of the water and I’m not just saying it because I wrote this one. I promise you if you try out Halo 3 Service Record and Halo 3 Gamer Card and think they’re better than Halo 3 Players.. I don’t know. I’m confident enough that Halo 3 Players kicks them to the curb that I include links straight to their app right here..

    • #ruby on rails
    • #halo 3
    • #facebook
    • #halo 3 players
    • #xbox
    • #My Stuff
  • 3 years ago
  • Comments
  • Permalink
  • Share
    Tweet

AjaxyXML updated for Mephisto 0.8 (And, I’m back!)

For some reason, the last few months (no clue when this started, really), this blog has been running in a purely cached mode. Mephisto broke somehow and wasn’t even starting up anymore, so apache was just serving the static HTML pages. I just made the leap to 0.8 of Mephisto and cleaned everything up and I seem to be back up and running.. I had to update my AjaxyXML plugin for Mephisto to work with 0.8 so anyone who has been having problems getting it to work with the new version, it should work fine now. Nothing new was added, I just rearraged everything into the new plugin structure for Mephisto… So go grab that if your using Mephisto 0.8. If your still on 0.7, you’ll need an earlier revision.

    • #plugins
    • #mephisto
    • #ajaxyxml
    • #ruby on rails
    • #My Stuff
  • 3 years ago
  • Comments
  • Permalink
  • Share
    Tweet

Low level caching for Rails 2.1

Rails has allowed you to do things like page caching and fragment caching for a while now but with Rails 2.1, they added a new cool feature for doing some more lower level things with cache. You can now cache pretty much anything you want, any way you want. It’s easy as pie too!

Rails.cache.fetch("my_caches_name", {:expires_in => 5.minutes}) { download_xml_file_from_web }

I’m using the above example in an application to cache an xml file from another website for 5 minutes. The expires_in option is only for if your using memcached as your cache store which I setup below in my config/development.rb..

config.cache_store = :mem_cache_store, '123.45.6.78:11211', {:namespace => 'myapp_cache'}

It’s that easy. I’m loving it. You can play around with the various settings. You can use a file store, memory store (which I think is default but won’t work well with multiple mongrels), drb store or the (imho, best option) memcached. There are other methods for Rails.cache that you can find here# in the documentation… Enjoy!

    • #ruby on rails
    • #memcached
    • #tips
    • #code
  • 3 years ago
  • 3
  • Comments
  • Permalink
  • Share
    Tweet

Almost there!

It’s amazing what a whole day of work (with the occasional Halo 3 break) will do for you. Last night when I updated, I felt like I had so much to do to get my application cleaned up and ready for prime time again. Since I’ve been planning on this 1.5 release to be a larger release, I haven’t been very careful about breaking stuff. I’m pretty OK with that though. I broke things on purpose because I knew I could implement them better. The only problem with it, was that my brain KNEW a lot of things were out of order but didn’t know exactly what. So after a day of fixing everything up, I’m back on track. The challenges backend is pretty solid. A few tweaks here and there are going to be needed, but it definitely works. I still need to pretty it up a bit too. The biggest accomplishment of the day, though, was reworking the flash system. Since I drop things like updating gamertags to the background, the user doesn’t get to see what’s happening. I have to use memcached, and check to see if the process is done. I kind of wrote myself into a corner with the old code because it was pretty much ONLY used for updating the gamertag. Now that I have some extra methods (like creating and finishing challenges) that need to be done in the background too, I had to make the system more flexible. I feel like I did this really well and it should work for me in the future if I have to add some more functionality to it.

On today’s agenda, I’m hoping to finish up the loose ends of the Challenge backend and get the views to a nearly complete state. I’ll probably continue to test out everything as I go along to make sure I didn’t overlook anything that I thought I fixed up. Some of the things I changed for this release sounded like a huge task in my head, but ended up only taking me about 10-15 minutes to do. One thing I changed that I thought would take me a while was switching from @user.id to @user.facebook_uid for all my user stuff. I thought it looked kind of silly to have haloplayers/user/123 which would like to the facebook id or 137412794. Using the facebook id for EVERYTHING (except database associations because I couldn’t really figure out how to get away from the primary id on that) took away a lot of confusion. Lessons learned.

Anyways. That’s about all I got. I don’t know why I’ve gotten into the rambling mood the last couple of days. I think I’m going to try and get a couple hours of sleep before I wake up and start working some more. Good night, folks!

    • #ruby on rails
    • #facebook
    • #halo 3 players
    • #halo 3
    • #My Stuff
  • 4 years ago
  • Comments
  • Permalink
  • Share
    Tweet

PeepCode: rSpec controllers and tools

PeepCode has released the 3rd installment of their 3 part rSpec guide in screencast form. I’ve bought and watched the other 2 and am currently downloading #3 as we speek. All the screencasts I’ve watched from PeepCode have proven to be very informative.. so I figured I’d take the time to promote them a little bit on my own. Head on over to peepcode.com and check them out. The screencasts cost $9 but it’s very worth it and highly recommended. A lot of the money goes right back to the community for various projects as well. Go check it out now!

    • #ruby on rails
    • #peepcode
    • #screencasts
    • #rspec
  • 4 years ago
  • 6
  • Comments
  • Permalink
  • Share
    Tweet

Not my plugin’s fault!

So, originally, I had posted with little response asking if anyone knew of a weird caching mechanism that was preventing my mephisto_ajaxyxml plugin from updating twitter status right away. I swore I tested this before, but it was brought to my attention that the XML file itself (if you load it up on your browser) just doesn’t update. I’m not quite sure why this is and I’m going to see if I can find anything online about it, but at least I can rest a little easier about trying to fix that part of my plugin.

Besides that, I am going to be releasing a new version of mephisto_ajaxyxml in the near future though. I want to add support for other formats, like RSS, ATOM and possibly JSON. I’ll also be looking into what else I could add easily. If you have any suggestions for what you’d like to see in the ajaxyxml plugin, let me know.

    • #plugins
    • #ruby on rails
    • #mephisto
    • #ajaxyxml
    • #My Stuff
  • 4 years ago
  • Comments
  • Permalink
  • Share
    Tweet

TextMate and your environment variables

I liked the cool looking RSpec results that I kept seeing in the peepcode RSpec screencasts so I set out to try and get them to work for me. It wasn’t long before I ran into a hurdle.. I started getting an error about a file not being found. It was a file called spec_mate.rb that was located in /Users/username/Library/Application\ Support/TextMate/Pristine\ Copy/Bundles/RSpec.tmbundle/Support/lib/. I’m still new to MacOSX so I wasn’t sure what could be going on and quite a few google searches for the exact error message I was getting and variations of the sort weren’t helping very much at all. I then found out that when you load an application (like TextMate) from the MacOSX GUI, the PATH variable isn’t set like it is if you load something from a terminal window. So here’s the quick and easy way that I got my TextMate and RSpec to work nice together. I’d assume this method will continue to work for various applications that require the PATH variable.

Load up your terminal.. We need to create the path where the environment will reside.

mkdir ~/.MacOSX

Now we need to create the environment file. Since this all started with TextMate for me, I’m going to use that, but you can use whatever text editor you like that also lets you save files in a hidden directory.

mate ~/.MacOSX/environment.plist

Now we just need to fill it with the PATH. This method will work with any type of environment variable. If you require something different from the PATH, just replace whatever you need in the key tag and whatever value you require in the string tag. Just copy this into your new environment.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>PATH</key>
        <string>/usr/local/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin</string>
    </dict>
<plist>

That’s all there is to it! You’ll need to log out and log back in (no need to reboot, just log out) for the changes to take place because these settings are only read when you log in. Now you should be able to load up TextMate from the GUI without worrying about your PATH variable. Hope this helps someone out!

    • #textmate
    • #rspec
    • #ruby on rails
    • #apple
    • #osx
    • #tips
  • 4 years ago
  • 18
  • Comments
  • Permalink
  • Share
    Tweet

A more real-time AjaxyXML

One of the reasons I created the AjaxyXML plugin for mephisto was to put more real-time data on your mephisto blog without killing your caches. AjaxyXML works pretty well, but it’s still not quite as ‘real time’ as I would like it. When I update my twitter status, it still takes a good amount of time to update on the blog even though it’s pulling in the XML file AFTER the entire page is loaded and just replacing the data in the div. I’m at a loss about why this happens and would love it if anyone wants to take a look at the source and give me any idea’s on how to fix this. I’m assuming there is some sort of caching that I’m not seeing that’s automatically caching the XML file, but I can’t seems to find this and am unsure how to fix it. If anyone has any ideas, please comment here. I would love to hear what you have to say. Thanks!

    • #plugins
    • #mephisto
    • #ajaxyxml
    • #ruby on rails
    • #My Stuff
  • 4 years ago
  • Comments
  • Permalink
  • Share
    Tweet

HowTo: has_many_friends

I’ve had a lot of requests for some sort of howto for my has_many_friends plugin for rails. I’m not wondrous at making howto’s, but I’ve been trying to rack my brain thinking of things I could demonstrate in a new post about how to use the has_many_friends plugin. So we’ll see what we can do. There won’t be any large code examples. I’ll just include a few snippets here and there, mainly because I wrote has_many_friends to have enough wiggle room so people can incorporate it in a few different ways. So let’s get started…

Read More

    • #plugins
    • #has_many_friends
    • #ruby on rails
    • #My Stuff
  • 4 years ago
  • 4
  • Comments
  • Permalink
  • Share
    Tweet

update for mephisto_ajaxyxml, now supports mootools!

I updated mephisto_ajaxyxml to support mootools for those of you who prefer to use the lighter weight mootools instead of prototype for your blog. As long as you have Ajax, XHR and Element support in your mootools download, you should be fine (If you select Ajax, it should automatically select a bunch of other stuff, the above included). To use mootools, just add the framework: ‘mootools’ option to the ajaxyxml tag.

{% ajaxyxml url: 'http://twitter.com/statuses/user_timeline/swemoney.xml', element: 'twitter', quantity: '1', framework: 'mootools' %}

I updated the 0.1 ‘release’ of the plugin to support mootools as well but I did not change the tag name or version number. Just make sure you have revision 20 or above and you should have mootools support for non-edge mephisto.

    • #plugins
    • #mephisto
    • #xml
    • #mootools
    • #ajaxyxml
    • #ruby on rails
    • #My Stuff
  • 5 years ago
  • 15
  • Comments
  • Permalink
  • Share
    Tweet

mephisto_relative_time :: Relative time in a liquid tag

When I signed up for twitter not too long ago, they had a nice item right in their xml file called relative_created_at that would return a time in relation to ‘now’ instead of the ugly ‘created_at’ which is a normal timestamp. The have since removed this item from their xml file (for caching reasons that are very understandable) so I went ahead and created a tiny plugin that provides you with a filter to use that form of time in any of your liquid plugins. You can pass any date as a string and this filter will convert the string to a Ruby date object and return the relative time from now that the date was. Check out the README or the source.

script/plugin install -x http://svn.dnite.org/mephisto_relative_time

The installation is quite easy. Just run the above and restart mephisto. To use the filter in your blog, do one of the following in any liquid template file.

Something happened {{ date_variable | relative_time_ago }} ago.
My birthday was {{ "2006-07-17" | relative_time_ago }} ago.
My birthday is coming up in {{ "2007-07-17" | relative_time_to }}

date_variable is just some liquid variable that contains a string with a date in it. The other 2 are examples that you can create any date in a string as long as Ruby can convert it correctly into a date object. The relative_time_ago function will return how long in the past from now said date happened, and the relative_time_to method will give you roughly how long until said date is reached. Piece of cake, eh? Now have fun with it!

    • #ruby on rails
    • #mephisto
    • #irc
    • #sounds
    • #fscript
    • #scripts
    • #My Stuff
  • 5 years ago
  • Comments
  • Permalink
  • Share
    Tweet

A couple fixes.. Some news..

I finally went ahead and whipped up a quick hack for mephisto to allow me to keep my twitter status and last.fm status updated without killing mephisto’s great caching features. Previously, I was using Dan Webb’s lastfm plugin for mephisto, and my recent modification to the same plugin to make it fetch twitter information instead of lastfm information. This works, to a degree, but the problem comes from the fact that this plugin uses a liquid tag that embeds the xml information on the page. What this means, is that mephisto will cache the page with the current status or lastfm list and recent updates won’t appear until the cache gets flushed. I know there’s a ‘setting’ in dan webb’s plugin that allows you to change the time in which mephisto will auto flush the cache and try to update the page, but it never worked for me.

What I did was create an Ajax request at the bottom of the page that updates the twitter and lastfm information on the fly. This means that the page that mephisto caches will always stay the same. The updates to twitter and lastfm will happen behind the scenes and update the page w/ javascript. Sucks for those of you who don’t have javascript enabled, but works for me. x=)

I want to whip up a versatile plugin for mephisto with this functionality, but that might take a little bit of time for me to pull off correctly and all. I just started a new job serving at a comedy club in the area, so that’s going to take some of my time in the near future, but I promise that as soon as I get some time and figure out how I want to do it, I’ll get this out in a plugin form. It won’t be a plugin just for twitter and mephisto. I want to make it so you can parse any xml file and update any element on your page with that information on the fly so you can keep dynamic content on your site without killing the caches. Stay tuned for more info on this.

    • #ruby on rails
    • #twitter
    • #mephisto
    • #life
    • #last.fm
    • #My Stuff
  • 5 years ago
  • Comments
  • Permalink
  • Share
    Tweet

Mephisto Plugin for Twitter

I’m late to the bus. I just found twitter yesterday and I think it’s a pretty cool concept. It’s nothing entirely useful, but it’s just fun. Don’t get me wrong, I’ve HEARD of twitter, just never tried it out until yesterday. Also, yesterday, I started screwing around with Dan Webb’s mephisto plugin for lastfm. What do these 2 things have in common you might be wondering? After looking at how easy it was to grab an xml file with users timelines from twitter via their api, I realized how easy it would be to modify Dan’s excellent lastfm plugin to work with twitter. So that’s what I did. I created a quick edit of the lastfm mephisto plugin to create my very own twitter mephisto plugin!

It seems to work pretty well. I’m actually intending on making it a little more feature packed in the future. There’s not a whole lot more you can do with it considering Twitter’s super duper simplicity, but I might take a stab at adding basic authentication so you can view ALL of your timelines with this plugin or maybe even come up with some way that you can edit create new status messages from your blog or your blogs admin page (when mephisto matures a little more to support admin plugins). Anyways, enough blabbing by me. Here’s the 411 on how to use it.

Install it like so from your mephisto root.

script/plugin install http://svn.dnite.org/mephisto_twitter

Restart your mephisto (I’m pretty sure this is necisary to load up the new plugin) and you can edit your layout page (or any of your liquid pages) to include your twitter status!

{% twittertimeline user: 'swemoney', type: 'user_timeline' as status %}
  {{ status.text }} - {{ status.relative_created_at }}
{% endtwittertimeline %}

If you want to know where your at in the loop, twittertimeline.index will return that for you. Any questions, post them here!

    • #ruby on rails
    • #twitter
    • #mephisto
    • #halo
    • #facebook
    • #haloplayers
    • #My Stuff
  • 5 years ago
  • Comments
  • Permalink
  • Share
    Tweet

More Ruby on Rails with Ubuntu… (rails.vim)

NOTE : This article is an update to an older wordpress blog I did. Since then I learned a few new tricks and thought this page could use a refresh. Enjoy teh Vim!

I wrote an article not too long ago about installing Ruby on Rails on Ubuntu quickly and easily. The one section I left pretty ‘in the air’ was definitely the IDE. I feel that Linux has the biggest choice when it comes to editor options.

If your using Windows, you’ll probably use RadRails. It’s feature rich. It does everything you need. And windows Java machine just seems to work more efficiently, in my experience, than the ones for linux. If anyone wants to give me some hints to improve my java machines performance, go right ahead. On the mac. You have TextMate. Mac’s also have a lot of options, but from what I’ve heard and seen. Very seldom do you develop Rails applications on a mac without using textmate.

Now, for Linux, you have a variety of things to choose from and I’ve dipped my hands in a few of them. First, I tried RadRails. RadRails is what I used in windows and it was familiar to me. Since it runs on all 3 platforms, I figured I’d give it a shot in Linux. The problem was, that it just seemed a lot slower than it ran in Windows. I’m not exactly sure why this is, but speed and reliability were the reasons I went looking for a better alternative. I did some research and found that some people used jEdit. But getting jEdit to work in Edgy was a chore, do I didn’t even try. gEdit was also another option. It highlights syntax. It can take plugins. It’s a pretty light weight editor. I tried this for a couple of days, but it just didn’t feel right.

Read More

    • #linux
    • #tips
    • #ruby on rails
    • #ubuntu
    • #vim
  • 5 years ago
  • 18
  • Comments
  • Permalink
  • Share
    Tweet
← Newer • Older →
Page 1 of 2
iOS application development, video games, random thoughts, apple. These are a few of the wonderful things you'll catch on my blog.

Pages

  • Projects
  • Apps
  • Secret Browser

Elsewhere

  • @swemoney on Twitter
  • Facebook Profile
  • tehdnite on Youtube
  • dnite on Digg
  • swemoney on Rdio
  • swemoney on github

Twitter

loading tweets…

  • RSS
  • Random
  • Archive
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr