Year: 2010

  • An HTML select that allows user created options

    I was thinking the other day that it would be useful to have a select option that people could also put their own options into on the fly.  Obviously you wouldn’t do this if you wanted completely normalization, but many times I have made selects with an “other” option, and then below put a text…

  • A modification of Lifehacker’s Invisibility Cloak

    Need to curtail your surfing during certain time periods?  I’ve tweaked Gina Trapiani‘s original code to make it a little more tolerant.  Put a few numbers into the “surfHours” array and you’ll be able to access your “blocked” sites for one hour after each hour listed.  As an example, if surfHours = [9,13,17] you can…

  • Making your facebook group safe for the enter key

    I’ve been very frustrated recently with the fact that in facebook groups, if you press enter while typing a post, it submits the post.  If you just want to make a line break you have to hit shift-enter. Fortunately we don’t have to live that way any more.  I’ve made a greasemonkey script for people…

  • Time for a smaller government

    I just read this intriguing piece in the Times:  http://www.nytimes.com/2010/11/28/opinion/28rich.html?_r=3&hp What’s great about this article is that I think the means that it describes and ends we would all find desirable: a government that votes it’s conscience. We differ greatly as to the means. I’ve been thinking recently that the problem is lack of accountability.…

  • We’re through Adobe

    I’ve been an anti-flash guy for a pretty long time now but I’ve been “ok” with running flash on machines when I had flashblock installed.  Today however I ceded to Adobe’s nag and installed the latest upgrade to Flash — bringing me to Flash Player 10.1  It ran mostly in the background, and I had…

  • Encyclopedia Brown and the Case of the Mysterious Sweater

    I wrote this in summer of 2008.  My gang of friends had all come down to Woods Hole, and Mark Z. had brought a sweater he had found in his apartment.  All the girls we knew were assembled, yet no  one claimed the sweater.  After the weekend, emails flew among the group trying to decide…

  • Javascript , YUI, Dates and Datatable

    I’ve had some issues with pushing strings in JSON to a browser and having the browser parse them correctly.  Some browsers will take strings as argument, some want numbers — it’s a bit confusing.  To avoid all confusion, I recommend making a new date and then setting the values, rather than using the ambiguous constructors,…

  • Using vi as a hex editor – linux instead

    Using vi as a hex editor – linux instead

  • A simple versioning implementation of Voldemort

    I’ve been playing around with Voldemort recently for a robust enormous datastore at Esped.com.  One of the frustrating things I found in getting into it was the lack of complete existing code samples, so I thought I’d contribute one to the community. This is a bit more than simple put/get because I need versioning associated…

  • Please to remember

    I seem to always get this backwards, so I’m writing it down as a mnemonic.  The correct ln syntax is ln <target> <linkname> e.g. ln /usr/bin/shutdown shutdown

  • My Unbirthday

    One year ago today, 8/18/2009, I was getting ready to go to lunch with Matt, Jorge and a consultant at work

  • Thinking of Texas

    I watched the old John Wayne “Alamo” movie and wondered about the text of the letter Travis sent out. To the People of Texas and All Americans in the World: Fellow citizens and compatriots: I am besieged, by a thousand or more of the Mexicans under Santa Anna—I have sustained a continual Bombardment and cannonade…

  • Note to myself to delete duplicates

    Taken directly from Brian’s page and added here so I don’t have to keep searching for this the one time a year that I need it, delete T1 from MyTable T1, MyTable T2 where T1.dupField = T2.dupField and T1.uniqueField > T2.uniqueField

  • damn you javascript

    I have be using more javascript and css than I would like recently, but the power is amazing. My most recent revelation was that “read only” is for suckers, and using “disabled” is a better way to protect elements in forms from user access.  the main reason is because you can set disabled=[true|false] on any…

  • backing up a mysql DB incrementally using mysql dump

    This script will backup your mysql DB using mysqldump, but because mysql dump locks the entire DB, this script only backs up one table at a time, thus only locking one table at a time.      #!/bin/sh # System + MySQL backup script # Copyright (c) 2008 Marchost # This script is licensed under…

  • Encrypting your jndi data source in Tomcat

    I was shocked to discover at my new gig that the database password that Tomcat loaded up into JNDI were not encrypted on the live site.  I was even more shocked that Tomcat does not provide a quick fix for this. So here’s mine.  Encode the password in your text file, and figure out where…

  • One more SQL hack (or How I Married a Genius)

    Here’s my problem.  I’m making the following SQL call from my application: select a.*, b.* from foo a, bar b where a.[column]= b.[column] I don’t know on the application end what fields are in what table, and I don’t know what field the join will be on — that’s all dynamic. I need to know…

  • Want to list all the tables.columns in your mysql DB

    SELECT CONCAT(TABLE_NAME,’.’,COLUMN_NAME) FROM information_schema.COLUMNS where TABLE_SCHEMA=’foo’ and TABLE_NAME like ‘USER%’

  • Smoke and Mirrors

    I’ve been thinking about the Texas School Board flap, and I’ve decided that

  • easy capitalization in MSWORD

    double click on a word to highlight it.  Shift+F3 capitalizes the first letter.  Shift+F3 again capitalizes the whole word.  Shift+F3 a third time lower cases the word.  Probably should make a macro for this in Intellij…