Coderguy’s Blog

Thoughts on code

About

Hello, my name is Daniel Ice. I am a software developer in the Dallas, TX area. I enjoy learning about new technology. I mostly focus on PHP and Ruby on Rails.

Archive for the 'Quick Tip' Category

jQuery Ajax Call Return Value

Wednesday, June 23rd, 2010

I found myself needing a really quick way to do an ajax call and get the value returned to a single var. I did a lot of searching and found a lot of convoluted responses that involved callbacks.  Using callbacks would be overkill for what I was doing. After much searching I finally found this [...]

Read the rest of this entry »

Show Forgein Keys in MySQL

Wednesday, November 25th, 2009

Here is a handy query I found the mysql reference manual for how to see all the foreign keys in a database: SELECT ke.referenced_table_name parent, ke.table_name child, ke.constraint_name FROM information_schema.KEY_COLUMN_USAGE ke WHERE ke.referenced_table_name IS NOT NULL ORDER BY ke.referenced_table_name;

Read the rest of this entry »

Couchdb CURL gotcha

Monday, October 5th, 2009

So this is one of those stupid little development issues that eats up an hour of your time.  I am documenting this in hopes that it will save someone from wasting an hour of your time. I am learning couchdb and using curl to interact with it’s RESTful api.  I wrote a view and was [...]

Read the rest of this entry »

Get the Mime Type of a File

Thursday, August 6th, 2009

If you would like to know the mime type of the file you can use the file command with the -i -b options.  Example: > file -i -b 20090731.flv application/octet-stream

Read the rest of this entry »

PHP Session Numeric Key Bug

Wednesday, July 8th, 2009

I was working on a 404 page today.  The pages that detected the 404 and routed it to the 404 page, would try and set the $_SESSION['404'] variable.  After setting the variable I was able to use it on that page.  However, after the redirect the variable was missing.  I could set other variables, and [...]

Read the rest of this entry »

Refresh MySQL Autocomplete: \#

Thursday, June 25th, 2009

Here is nifty little tip.  If you need to have your command line MySQL autocomplete enabled or refresh the just type \# at the command line. mysql>\# This is great for those times when you creating a lot of tables.

Read the rest of this entry »