• aboutmydevice.com : a new site that helps explore a mobile browser’s Javascript properties

    Here’s the latest website I’m releasing onto the world: aboutmydevice.com. I wrote  it so that I could explore what Javascript properties, objects, and values exist on the browsers of various mobile devices. I walk into a store, go to a phone, load up aboutmydevice.com, and see what kind of properties this browser has. It’s been more

  • macbook pro turns on but screen stays black — my solution

    The Apple Macbook Pro would turn on, but the screen would not.  The screen would stay black.  I could tell the computer was on because when I hit the “caps lock” key, the green light on the key would turn on and off. I fixed this the following way (this is basically resetting the Power more

  • UNIX/AWK Tricks: How to copy a long list of files into a directory

    Make your list of files, with complete paths, call it “imgList.txt”. Put every file on a new line. Write a small awk script with the following 1 line: { printf(“cp %s images/\n”, $0);} Save the script as “copyList.awk” Do the following command: awk -f copyList.awk imgList.txt | sh Brief explanation of the awk script: %s more

  • HTML Character Entities in Javascript

    Sometimes you need to write html character entities in javascript, but html character entities can’t be used, because they don’t get interpreted by javascript. In javascript, you need to use the equivalent unicode character codes instead. HTML character entity, wrong: formElement.value = “Dirección”; You get: Dirección Unicode character code, correct: formElement.value = “Direcci\u00F3n”; You get: more

  • Handy MySQL Commands

    Log into mysql: (enter password on next prompt) mysql -u username -p   Show all databases on server: mysql -u root -p -e ‘show databases;’   To reset an auto_increment field to 1: ALTER TABLE tbl_name AUTO_INCREMENT = 1;   To load a local csv file into an empty existing table: (This assumes you’ve already more