Spike
October 31st, 2008
Wow! Donor Tools peaked at almost 2000 visitors yesterday thanks to linkage from Best Web Gallery and CSS Mania
Parenting Theory
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.
Track Referrals in Your Rails App
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 |
The 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.
Wildcard (*) Searches With Thinking Sphinx
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 enable_star
and 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
.
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.
Now, re-run rake thinking_sphinx:configure
, re-index (rake ts:in
), and restart the Sphinx daemon (rake ts:run
), and it should work.
Chuck Baldwin for President
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
Haiti Hurricane Update
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.
PassiveRecord
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.
There's more! Read the rest of this entry
Subscribe
Network
Archives
- July 2009 (1)
- May 2009 (4)
- March 2009 (1)
- February 2009 (1)
- December 2008 (2)
- November 2008 (1)
- October 2008 (7)
- September 2008 (4)
- August 2008 (4)
- June 2008 (2)
- April 2008 (1)
- March 2008 (1)
- February 2008 (5)
- January 2008 (1)
- December 2007 (1)
- November 2007 (4)
- October 2007 (1)
- September 2007 (1)
- August 2007 (3)
- July 2007 (2)
- June 2007 (5)
- May 2007 (6)
- April 2007 (3)
- March 2007 (4)
- February 2007 (5)
- January 2007 (5)
- December 2006 (6)
- November 2006 (1)
- October 2006 (8)
- September 2006 (12)
- August 2006 (7)
- July 2006 (6)
- June 2006 (6)
- May 2006 (2)
- April 2006 (17)
- March 2006 (15)
- February 2006 (7)
- January 2006 (12)
- December 2005 (25)
- November 2005 (11)
- October 2005 (3)
- September 2005 (2)
- August 2005 (4)
- July 2005 (5)
- June 2005 (1)