October 31st, 2008
October 31st, 2008
As our children are developing into ever more sophisticated and rational human beings, we are degenerating – devolving into shadowy cave-people, with heightened reflexes but incapable of forming a complete sentence or retaining a memory for more than 15 seconds. No. Complete. Sentence. Ungh! But! We can catch a glass jar tipped by a toddler as it hurtles its way to the ground. Me kung-fu cave dad.
October 30th, 2008
Here’s a quick and easy way to track exactly where your signups are coming from, and who referred any given customer, without having to cross-reference your analytics program.
1 2 3 4 5
before_filter: set_referer def set_referer cookies[:referer] = request.env['HTTP_REFERER'] if cookies[:referer].nil? end
set_referer method sets up a session variable that keeps the original referrer with your customer, no matter how many pages they click through before signing up.
You can email this variable to yourself when they sign up, or store it in the database to keep track of who came from where.
October 24th, 2008
Ryan Bates has a helpful screencast about the using the excellent Thinking Sphinx Rails plugin for the Sphinx search engine.
There seems to be a bit of confusion over how to enable wildcard (star) searches with Thinking Sphinx. Wildcard searches would let you search for partial words, so “thin*” would match “Thinking Sphinx” and “Thinner”. This is pretty useful, and for Donor Tools it is essential.
Turns out it’s really easy to turn on wildcard search. There is no need to make any changes to your Sphinx setup or add a
config/sphinx.yml file. In your
define_index block, simply add
min_prefix_len like so:
1 2 3 4 5
define_index do ... set_property :enable_star => true set_property :min_prefix_len => 3 end
enable_star simply turns on wildcard searching. However, this won’t do much good unless you also enable prefix indexing using
min_prefix_len sets the minimum number of letters that Sphinx will index. From the Sphinx docs:
...indexing a keyword “example” with min_prefix_len=3 will result in indexing “exa”, “exam”, “examp”, “exampl” prefixes along with the word itself.
You can also set
min_infix_len, which does the same thing as
min_prefix_len, except it does it on the middle of the word.
Infix indexing allows to implement wildcard searching by ‘start*’, ’*end’, and ’*middle*’ wildcards.
Caution: Infix indexing can cause your index to grow, and may slow down searching.
rake thinking_sphinx:configure, re-index (
rake ts:in), and restart the Sphinx daemon (
rake ts:run), and it should work.
October 20th, 2008
I love change. I love hope. And I love choices. But something about the way our electoral process works really rubs me the wrong way. Sure, it’s great that we get to vote for our President. But someone out there – someone with power – has picked my two choices for me, and for the past year has been hammering it into my head that if I don’t choose one of these two prescribed choices, then I’m throwing my vote away. You know what I realized? Aside from minor policy differences, like what percent of a tax cut the middle class will get, and whether we should invade this country or that country, there really is very little difference between the two mainstream candidates. Both Senators Obama and McCain voted in support of FISA, the Patriot Act, and the Bailout Bill, three of the most odious and nefarious acts of legislation that have done incredible damage to the American way. Neither of these two candidates provide any real solutions, and when put to the test, we see that in the end, a vote for McCain is the same as a vote for Obama; and neither will bring about any real change or mitigate or destroy the corruption that now gnaws away at the character of our government, nor will they stop the cancerous expansion of government powers that make our current government look and act more and more like the government of King George, from whom we won our Independence.
So if there is no real difference between the two, and I’m only voting for one or the other because I want to be on the winning side, or because I want to vote for one so the other won’t win, then I am truly wasting my vote.
What’s a patriot to do?
Well, did you know that there are actually six noteworthy candidates (plus a few others) for president this election? “But”, you say, “none of these candidates can win. Why bother voting at all?” You’re right, we might as well just give up. No sense in playing if we can’t be on the winning team, right? Look, the whole country is saying that. Everybody is just rolling over and letting the political establishment have its way with them. If we all just comply then we’re going to get exactly what people with power want to give us. That’s what the American Revolution was about folks! In a way, the American Revolution continues to this day. The fight against tyranny and oppression will go on as long as there are good and evil (and I don’t mean the “axis of evil” – I mean real evil, and people who would use power to harm other people). As long as we’re here on this earth we each have a responsibility to fight to maintain our freedom and our individual rights and to preserve and protect our Constitution against all enemies, foreign and domestic. The Constitution (read it, it’s good) limits the government’s power, and it grants the government power only by the consent of the governed. Our responsibility as citizens is to give that consent, to withhold our consent to tyranny, and to keep the government accountable by electing officials that respect the people and their position as representatives of the people.
One of the most obvious ways that we fulfill this responsibility is by choosing our executive, our President. If we believe in the Constitution, then we ought to elect a president who shares our reverence of liberty, freedom, and the Constitution, and who has demonstrated an understanding of these tenets, and who will do the most to uphold these precious things.
That is why I have decided to support Chuck Baldwin for President of the United States.
Baldwin does not have as much political experience as Obama or McCain, but in this case I think that might be a good thing. He certainly is not part of the political establishment. Based on his writings, his history, and his character recommendations, I believe that Chuck Baldwin is the candidate best suited to execute the office of President of the United States.
- Ryan Heneise
October 15th, 2008
Haiti Hurricane Update
We’ve been collecting money for Haiti hurricane victims for several weeks now, and although we haven’t received quite the response that I had hoped for, we did raise $45. Since this isn’t really enough to make a dent in providing clean water, we’ve decided to donate the entire amount that we raised, plus our matching funds, to Yéle Haiti, the aid organization founded by musician Wyclef Jean. The money will be donated to their Haiti Storm Relief Fund.
Check out the powerful videos on the homepage of www.yele.org. I also have some pictures of the aftermath .
“I’ve seen extreme poverty before, but I’ve never seen it coupled with a natural disaster.” – Matt Damon, speaking on the video on Yéle Haiti.
Those of you who know me know that I share a special connection with Haiti. My parents were missionaries there, and I spent many years there growing up.
October 2nd, 2008
Ever need to use structured data that doesn’t need its own database model? Ryan Bates shows you how in a recent Railscast: Non Active Record Model.
If you have more than one non ActiveRecord model, you’ll find yourself starting to duplicate a lot of code. I did recently, so I extracted a bunch of functionality into a plugin called PassiveRecord.