A fusion of technology, music, and geekyness.
Currently Browsing: Programming

Server Update: Migration to Debian, Polyglot Projects, and More!

I am proud to announce that TechnoGeeks now has it’s own server in Atlanta, GA! I have officially migrated from Ubuntu to Debian in the process. I have finally scrubbed Ubuntu from my life for good!

Operating Systems of Choice
Server: Debian Squeeze
Desktop: Arch Linux
Phone: Android

I am starting to nerd out a lot more lately and will expand TechnoGeeks to be able to magically host several projects of mine. This includes web applications written in PHP, Ruby, and Lua! I started playing around with some of the Kepler Project frameworks (WSAPI, Xavante, and Orbit) and have a fully functioning Code Snippet library called Snippy. Orbit is ULTRA FAST but the documentation and code maintenance is VERY POOR. I really hope these guys clean things up as they have something really nice going here. More updates soon!

Update 12/5/2011:
I have several new projects and services that are now up!


Sputnik: An Extensible Wiki Engine in Lua

sputnik-logo

While learning Lua for WoW addons, I was lucky enough to discover a neat pure lua app called Sputnik. It is a wiki engine that can be extended to do just about anything you want it to do. For example, I have all of the data storing in git with a git plugin and changed the default auth to hit MySQL instead of a flat file. The possibilities are endless and they have several example plugins for ideas (issue tracker, discussion posts. etc).

I hope one day to get good enough with Sputnik and lua to provide a Postgres auth plugin and a blog plugin as well. Yuri, the project maintainer is really good at answering people that need assistance on their mailing list. It was there that I discovered they have a git repo and a new version: Galaxy.

The bottom line: this project is worth checking out and contributing to people so get to it!


Now Learning Lua!

Lua For the Win!
I recently have randomly become quite interested in Lua. The reasoning is due to the fact that I interact with two things on a daily basis that are configured and/or scripted in Lua: World of Warcraft and the Awesome window manager. I have had a blast over the weekend learning the basics of the languages and WoW addons. You can find the entire first edition of a very nice guide to learning Lua on their website. In addition, I found the resources at www.wowprogramming.com to be quite helpful.

Some essentials:

  • WowLua – An addon that allows you to write and run Lua in game.
  • Warcraft Addon Studio – A Visual Studio (VB) like application to let you quickly build frames and export them to XML.

Celistine
The first mod I wrote was called Celistine, and was written to monitor my wife in game :D It allowed her to whisper me for auto-invites to a group, monitors her range and informs me if she is far, and spams her with whispers if my health gets lower than 25%.

celistine

Deeps
After that, I decided to modify an example I found in the book I am reading (World of Warcraft Programming) and create a simple frame that displays DPS and other facts as I am in combat. I decided to call it Deeps :) See below for the screenshots, code, and feel free to try it out yourself.

deeps

deeps2

-- Set up some local variables to track time and damage
local start_time = 0
local end_time = 0
local total_time = 0
local total_damage = 0
local average_dps = 0
local in_combat = false

function CombatTracker_OnLoad(frame)
	frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
	frame:RegisterEvent("PLAYER_REGEN_ENABLED")
	frame:RegisterEvent("PLAYER_REGEN_DISABLED")
	frame:RegisterForClicks("RightButtonUp")
	frame:RegisterForDrag("LeftButton")
end

function CombatTracker_OnEvent(frame, event, ...)

	if event == "PLAYER_REGEN_ENABLED" then
		-- This event is called when the player exits combat
		end_time = GetTime()
		total_time = end_time - start_time
		average_dps = total_damage / total_time
		CombatTracker_UpdateText()
		CombatTracker_ReportDPS()
		in_combat = false
	elseif event == "PLAYER_REGEN_DISABLED" then
		-- This event is called when we enter combat
		-- Reset the damage total and start the timer
		CombatTrackerFrameText:SetText("In Combat!")
		total_damage = 0
		start_time = GetTime()
		in_combat = true
	elseif event == "COMBAT_LOG_EVENT_UNFILTERED" and in_combat then
		local timestamp,log_event,source_guid,source_name,source_flags, dest_guid, dest_name, dest_flags, spell_id, spell_name, spell_school, amount = ...

		if string.match(log_event, "_DAMAGE") then
			if source_name == UnitName("player") or source_name == UnitName("pet") then
				--ChatFrame1:AddMessage(source_name .. " is doing teh hurt!")
				if amount ~= nil then
					total_damage = total_damage + amount
					end_time = GetTime()
					total_time = end_time - start_time
					average_dps = total_damage / total_time
					CombatTracker_UpdateText()
				end
			end
		end
	end
end

function CombatTracker_UpdateText()
	local status = string.format("%ds | %d dmg | %.2f dps", total_time, total_damage, average_dps)
	CombatTrackerFrameText:SetText(status)
end

function CombatTracker_ReportDPS()
	local msgformat = "Dished out %d damage in %d seconds (%.2f dps)."
	local msg = string.format(msgformat, total_damage, total_time, average_dps)
	if GetNumPartyMembers() > 0 then
		SendChatMessage(msg, "PARTY")
	else
		ChatFrame1:AddMessage(msg)
	end
end

Startup Script for Rails with WEBrick

I finally started playing with rails again. I decided to play around and start the basics of a billing application. I was initially debating web app versus a desktop app (rails vs ruby-gtk). I wanted a reason to finally start using rails so I decided to make it a web app. I then realized I may be able to simulate a desktop app with rails. I pulled in the base ruby packages, manually compiled RubyGems and installed necessary gems, and decided to script a startup routine so I could create a launcher on my desktop. This solution is far from perfect but it manages to fulfill my needs. My “desktop rails app” uses the built in standalone webserver WEBrick and sqlite3 for its backend.

#!/bin/bash
cd /home/jesse/rails/billing

if [ ! -f tmp/pids/server.pid ]; then
	script/server -d
fi

while [ `netstat -tan | grep 0.0.0.0:3000 | wc -l` != 1 ]; do
	echo "Server not started yet..."
	sleep 1
done

google-chrome http://localhost:3000/customers &
tail -f log/development.log

# Server can be killed with:
# kill -INT `cat tmp/pids/server.pid`

I then created a launcher simliar to this:

launcher

When I double click on the icon the first time it pauses for about 5-6 seconds while WEBrick initializes and binds to port 3000. As soon as it detects the webserver listening, I launch google-chrome to the default view. Each time I click the icon there after, the webserver is already running so the google-chrome tab kicks off instantly.


CakePHP eCommerce Done Right: Mocha Shopping Cart

Mocha Shopping Cart

Mocha Shopping Cart

A few months back I posted on CakePHP eCommerce and the lack of good solutions. Well that is now no longer the case. I would like to be one of the first people to introduce you to Mocha Shopping Cart. We have been working day and night (literally) to come up with a solution for the small and medium sized business owners to sell their products online easily. We also have geared Mocha to be extend-able and easy for CakePHP designers and developers to add in their own twists for clients.

Mocha is written entirely in CakePHP and jQuery and is certainly the best CakePHP eCommerce app out there. Why do I say that?

Mocha Shopping Cart is…

  • Fully hosted, secure, pre-installed
  • Very easy to set up and configure
  • Themable and Modular (Plug ins docs in the works)
  • Works with most popular payment and shipping apis (UPS, USPS, Authorize.net, Paypal, etc.)
  • Charges no transaction fees and no setup fees

If you still don’t believe me, Mocha is offering a limited time only Pre-Launch coupon code that gives you the first month FREE. You can try it for yourself and see how you like it. I think you will agree that it beats CakeCart and BakeSale, HANDS DOWN! And no, Mocha is not free (after the first 30 days). The costs help to speed up development, pay for server and hosting fees, and pay for that cup of coffee that us developers need when its 8 AM and we are having to talk with <insert_API_name_here> first thing in the morning.

Official Website: Mocha Shopping Cart
Blog with coupon code: Get a free trial of Mocha Shopping Cart


« Previous Entries

Powered by Wordpress | Designed by Elegant Themes