Archive for the ‘Web Development’ Category

Sencha List Disclosure with a Different Event than Itemtap

Monday, October 3rd, 2011

Sencha 1.0(ish) doesn’t have an option for tying a different event for the onItemDisclosure tap than the itemtap event. Here’s a convenient workaround. Set the onItemDisclosure to true to force it to show up, but give all the work to the itemtap event.

onItemDisclosure : true,
listeners : {
  itemtap : function(record,index,item,e){
    if (e.getTarget('.x-list-disclosure')) {
      Ext.Msg.alert("Disclosure clicked!");
    } else {
      Ext.Msg.alert("Item clicked!");
    }
  }
}

FIN!

BASH, C-Shell, etc.

Wednesday, September 28th, 2011

I was trying to figure out how to change my default shell from CSH to BA$H for my ODU CS login after doing some customization on my .bashrc file. If you’re in the same boat as me, a few simple changes will take care of things. This can all be done without root access.

  • $ echo $SHELL # find out what shell you are currently using, gives me something like /usr/local/bin/tcsh
  • bash # to switch to a BA$H terminal. exit to your csh
  • If a csh ~/.login doesn’t exist, create one and put the command exec bash in it. You could also use the full path to the shell you want to use
  • Run source ~/.login to restart your csh with the new rule… it should skip you over to bash instantly

This got me far enough to get a terminal but not far enough to use Vi as I would like to and expect to. I use Putty, since most of the time I have to be on a Windows computer. Times are changing though and hopefully soon I can drop it entirely in favor of Ubuntu. If you are having trouble with numbers, arrow keys, the insert key, etc. try some of these helpful hints:

  1. Open putty and load your session
  2. Go to terminal -> features and check “disable application keypad mode”
  3. echo $TERM and make sure that Putty and your server are using the same type. vt100 is the most common
  4. set term/device=vt100
  5. Load your Putty session and go to Connection -> Data and enter “vt100″ (without quotes) or whatever type you decided on. Optionally you can enter your username here as well so you only type your password on login.
  6. Under Terminal -> Keyboard, set “Ctrl-H”, “Standard”, “ESC[n~”, and the default for everything else on that panel
  7. For the rest, follow the directions here.

… this is still a post in progress. Sadly, I’m still not working with a full deck of Vi.

Enjoy!

Use Putty to Store and Manage Your MySQL Tunnels

Wednesday, September 21st, 2011

I’ve been manually creating my tunnels for the same connections over and over again for the longest time. It gets old. I just realized Putty can do this for me. You must remember to go back to the main Session page to click “save” since there isn’t a save button on all pages–do this prior to opening a session. The follow up pic is of a typical MySQL Administrator setup to use with the tunnel.

Putty
MySQL Administrator

Sencha Touch Checkbox Defaults

Monday, September 19th, 2011

Sencha Touch is amazing… simply amazing.  One of the things I’ve found very unintuitive for form panel configuration objects, though, is the checkbox and how to set a default value.

For most field types, you simply type value: 'some value'. With the checkboxfield, you instead have to use value: true to indicate what the value of a checkbox is when it is checked. The default state is then set by checked: true. It makes sense, but isn’t intuitive and perhaps a bit unnecessary to have both.

.htaccess Changing the document root from public_html to a subfolder

Sunday, March 6th, 2011

If you’ve ever needed to host your files for a site in a subfolder such as “public_html/mysubfolder/” as if it were “public_html/” so that your URL displayed is (for example) “http://www.epiphanydigital.com/” instead of “http://www.epiphanydigital.com/mysubfolder”, then you may want to try something like the following htaccess black magic:

RewriteEngine On
RewriteRule ^$ /mysubfolder/ [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/mysubfolder/
RewriteRule ^(.*)$ /mysubfolder/$1
RewriteCond %{SCRIPT_FILENAME} -d
RewriteRule ^epiphanydigital.com/(.*[^/])$ http://www.epiphanydigital.com/$1/ [R=301]

Now, a better way is to just modify your VirtualHost record directory on a site by site basis, but if you’re like me and you’re on a shared host, you just don’t have access to do this.  An .htaccess rewrite rule will cost slightly more overhead than a VirtualHost record.


©2005-2012 Blog – Epiphany Digital is proudly powered by Badgers and Web Design is by Epiphany Digital
Entries (RSS) and Comments (RSS). 36 queries. 0.801 seconds.

Thank you for visiting this site. The web fairy will visit you in your sleep... you know, I was going somewhere with this, but it really doesn't have as much innocent charm as the tooth fairy, especially when I picture the web fairy as someone much like the Simpsons' Comic Book Guy but with wings. It's just not something I want.