Tuesday, August 5, 2008
SEO simplified
Monday, July 21, 2008
Safari scrolling div select bug
Picture this:
-A div that is hidden until moused over (abs position, z-index > 1)
-Onmouseout, it hides itself
-When it is displayed, it has an overflow:scroll
In Safari, when you would scroll and try to click any of the items in the list, it would scroll back to the beginning!
The fix is to make the div visibility:hidden, not display:none. So, since this would leave the scrollbar with no div in IE/FF, I did this in PHP:
if(strstr(strtolower($_SERVER['HTTP_USER_AGENT']),strtolower("Safari"))) {
$visibility = "visibility:hidden";
} else {
$visibility = "display:none";
}
Then just printed out the var in the JavaScript.
Wednesday, July 9, 2008
Stringing together replaces in JS
lc_make = full_make.replace("%20","_").replace("%2520","_").replace(" ","_");
Monday, June 30, 2008
CLI PHP
if($file= file_get_contents('myfile.csv')) {
$line = split("\n",$file);
foreach($line as $lines) {
$data = split(";", $lines);
echo $data[0] . "\n";
}
} else {
echo "couldn't open";
}
Sunday, February 17, 2008
How to clear cache
- Internet Explorer 6: choose Tools->Internet Options, Delete Files (screen shot)
- Internet Explorer 7: choose Tools->Internet Options, Delete->Delete Files (screen shot)
- Firefox: (Mac->Firefox | PC->Tools) ->Preferences, Advanced, Network->Clear now (screen shot)
- Safari: Safari->Empty cache (screen shot)
Tuesday, January 29, 2008
Optimus Mini Three
After talking about how I wanted copy and paste buttons on the right because I'm a lefty on the mouse, I finally got it! It's called the Optimus Mini Three. <-- pasted using the middle button.
Mine is so pretty too...I made the buttons be flowers - well, and a firefox logo until I learn that I made the shift + top button be "open new tab".
Friday, January 11, 2008
IE onchange
Friday, December 7, 2007
Firefox not showing stylesheet
Turns out it's a server misconfiguration, discussed in this article.
Apache reads a "mime.types" file. Make sure it includes the line:
text/css css
You can also use Apache configuration directives to set the Content-type. If the worst comes to the worst you may be able to use a .htaccess file (which applies to the directory it is in and all subdirectories) to set the configuration (the default Apache configuration disallows this, but many hosts turn it on to allow users some degree of configuration).
AddType text/css .css
Tuesday, December 4, 2007
CuteFTP Backup
I've been moving my files from my old MacBook, which is having some issues, to my new MacBook Pro. Among many things, this means moving over my CuteFTP site list. Here's how to do it...
Copy these 2 files form the old computer:
YourUserName > Library > Preferences > com.globalscape.CuteFTP2.plist (Settings) and CuteFTP AddressBook.plist (Address Book).
SCP mini-man
SCP an entire directory from local to remote:
scp -r directoryname roxane@hostname:directoryname
SCP a file from local to remote:
scp file.txt roxane@hostname:directoryname
Tuesday, November 27, 2007
Symbolic Links in Unix
ln -s /long/directory/path/to/make/shorter mypathWednesday, November 14, 2007
Boring business post
-use versioning software for everything
-set up every (5 page or more) site in a CMS
-set up every site using only CSS layout
-have a QA person from the start
-have an after-hours staffed phone for problems
Things I know I've done right:
-used a good contract book
-got a good accountant
-got an office
-kept on learning!
Tuesday, November 6, 2007
Outlook 2007 HTML email rendering
1. Make all CSS internal (in the head)
2. Make the layout table-based with only one level embedded at the most
3. Make all backgrounds be rendered by CSS
4. Make the page validate using Tidy (the FF extension)
Monday, October 29, 2007
Awstats
1. /etc/awstats/awstats.mysite.com.conf
This file contains the ExtraSections area.
2. There is an error in the PDF documentations for this section, use their site documentation instead.
3. The stats it produces are actually pretty good (and LIVE).
Friday, October 26, 2007
Follow up to CakePHP Post
1. To attach javascript to a submit button the HTML way:
<input type="submit" id="send_button" onclick="disableMe('send_button')" value="Register" />The Cake way:
submit('Register',array('id'=>'send_button', 'onclick'=>"disableMe('send_button')")); ?>2. Complete list of HTML helpersThursday, October 25, 2007
Is a number, is not a number
PHP for starts with a letter: if (preg_match ("/^([A-Z][a-z]+)$/", $country)) {
}
Just in case, ya know.
And to round out my week of SQL...dates must be in quotes.
Tuesday, October 23, 2007
Importing CSV into PHPMyAdmin
Monday, October 15, 2007
Ajax frameworks
http://script.aculo.us/
http://developer.yahoo.com/yui/
http://jquery.com/
http://www.gregphoto.net/sortable/index.php
Sunday, October 14, 2007
Sed is fun!
Did an ls > ../file.txt first, then replaced all spaces with nothing
(while read f; do newf=`echo $f | sed 's/ //g'`; mv "$f" "$newf"; done;) < ../file.txt
To test first before doing it, can do:
(while read f; do newf=`echo $f | sed 's/ //g'`; echo mv "$f" "$newf"; done;) < ../file.txt
Take the contents of a file (in this case a list of images) and add the URL to the beginning of each line:
sed 's/^/http:\/\/www.little-truck.com\//' <> file2.txt
Wednesday, October 10, 2007
Google Maps - As the Crow Flies
The next task is to figure out how to create these points on the fly.
Tuesday, October 9, 2007
Subversion
Installing a GUI version is easy though...I just used this one.
Monday, October 8, 2007
At job in Mac OSX
In OSX, you have to specify -t YYMMDDhhmm. Example:
at -t 10081637.30
Don't forget the CTRL + D to schedule it!
In my example, I have it pointing to a file that has only one line:
sh uploadAtCertainTime.sh
No more waking up at 6AM (that's 9AM EST) to upload press releases! :)
---
Here is my uploadAtCertainTime.sh script:
#!/bin/sh
USER=username
PASSWD=supersecretpassword
ftp -n ftp.myhost.org <<script
user $USER $PASSWD
binary
cd public_html
lcd /Applications/xampp/htdocs/[wherefileslive]/
put file.html
quit
SCRIPT
Post Script: this only works if you leave your computer on. D'oh!
Monday, September 17, 2007
Google Analytics "Outclicks"
<a href="http://www.example.com/files/map.pdf" onclick="javascript:urchinTracker ('/thingyouwant/toshowupinanalytics'); ">
Friday, September 14, 2007
imagettftext
Here's what I did:
1. Uploaded a few ttf fonts
2. Put this in index.php:
<?php
$folder=dir("."); //The directory where your fonts reside
while($font=$folder->read())
{
if(stristr($font,'.ttf'))echo '<IMG SRC="img.php?'.substr($font,0,strpos($font,'.')).'">'; //only ttf fonts
}
$folder->close();
?>
3. Put this in img.php:
$font=$_SERVER["QUERY_STRING"];
header("Content-type: image/png");
$im=@imagecreatetruecolor(200,30)or die("Cannot Initialize new GD image stream");
$black=imagecolorallocate($im,0,0,0);
$white=imagecolorallocate($im,255,255,255);
imagefill($im,0,0,$white);
imagettftext($im,18,0,5,25,$black,$font,$font);
imagepng($im);
imagedestroy($im);
4. View the index.php file on a server
Thursday, September 13, 2007
Let them eat cake
All I did was unzip, upload, create a db, edit the database.php file, and create the home.thtml file.
It's a little hard to find their manual, so here's a link.
Monday, September 10, 2007
Illustrator Workaround
Recently I've gotten a few comps from graphic designers in Illustrator, but I don't know the program very well. So I got a graphic designer to teach me how to re-import it into Photoshop (just until I learn Illustrator...eventually).1. Select in Illustrator the pieces that will become a layer in Photoshop

2. Paste it into Photoshop, choosing Pixels

3. It will automatically be put in a new layer.

Thursday, August 23, 2007
Google Advertising Tools
Adsense:
-skyscrapers have better clickthrough than horizontal ads
Adwords:
-images ads (maybe those don't exist anymore?)
-enable "site targeting"
-a nice way to manage multiple Adwords accounts
Getting better traffic (kindof a "duh" list):
-create a 2 sentence description of your site that uses your keywords
-see if webhost has a search engine submission service
-submit to directories (dmoz, yahoo)
-submit RSS feed to aggregators
-send out a newsletter
Making your site rank higher:
-check it in Lynx
-meta keyword tag should only have about 12 words, both single and plural versions of your major keywords
-sitemap!
-100-250 words on the home page
-title, h1, h2... keyword hierarchy
There was also a whole chapter on how to run an adult site, another on Adwords API programming, and another on another on Adsense API programming. All of which I skimmed.
Tuesday, August 21, 2007
Converting WMV to SWF
It has just about the ugliest interface ever, but it converts to FLA and then you can open in Flash and publish as SWF. Here's the result.
Friday, August 17, 2007
Removing the background from a Flash movie
What I did:
1. Remove the background image from the background layer
2. Set the Alpha on the background layer to 0
3. Added to Flash code in the HTML
param name="wmode" value="transparent"
4. In the embed tag added
wmode="transparent"
5. Republish
Saturday, August 11, 2007
An Event Apart
I decided not to go to the Web 2.0 Summit, it's just too expensive with not enough potential.
However, this year I'm going to An Event Apart! Eric Meyer, Zeldman, Joe Clark...these are the people who are out there doing it. The Summit is the people who talk about the people doing it.
Friday, August 10, 2007
Web 2.0 Summit
Pros:
- Good conference topics
- Speakers include Steve Ballmer, Danny Hillis, Google, Yahoo!, Viacom, HP, EMI, Sun, Verizon, eBay, Facebook, and that Twitter guy
- Launchpad seemed to be what everyone blogged about last year
- Networking
- $3595
- Despite the possibility of "networking", I may be too small of a fish to get anything out of it.
Wget mini man
Here is my Wget mini man page:
--level=0: go as deep as needed
-r: recurse
-np: no parent (go deep instead of shallow)
-L: follow relative links only
-p: get all images, etc. needed to display HTML page
wget --level=0 -r -np -L -p http://www.little-truck.com
Wednesday, August 1, 2007
Adding a path to your Bash profile
When installing a new program for the UNIX shell, if you want it to be able to be run from anywhere:
vim .bash_profile
PATH=$PATH:/usr/local/bin
export PATH
Restart the terminal and it's done.
SecureClient mocks me
The error was: "SecureClient services are down. Please reboot your machine to start them."
After searching numerous forums and finding that "it just doesn't work" on OS X > 10.3.9, I went into the terminal, to the /opt/CPsrsc-50/bin folder, and ran "sudo ./scuninstall". It uninstalled, despite some errors and I was able to run the installer again.
Friday, July 27, 2007
New site design - and branding!
So tonight I redesigned the site by only changing the stylesheet - what do you think? The color scheme is from Adobe's Kuler site, it's called Peer e0 (stupid Flash so you can't bookmark)
Wednesday, June 27, 2007
.htaccess and .htpasswd creator
That link creates a password protected directory or file by giving you the code for your .htaccess file and then encrypting the password for you (!) for the .htpasswd file.
Friday, June 22, 2007
Class with multiple link stylings
.navPriSelected a:link, a:visited {}
will style .navPriSelected a:link AND ALL a:visited, not .navPriSelected a:visited.
So the code for the above should be:
.navPriSelected a:link, .navPriSelected a:visited {}
Thanks, Jacob! :)
Wednesday, June 20, 2007
Google Sitesearch
<form method="get" action="http://www.google.com/search" target="_blank">
<input name="ie" value="UTF-8" type="hidden">
<input name="oe" value="UTF-8" type="hidden">
<input name="q" maxlength="255" value="" style="width: 80%;" type="text">
<input name="btnG" value="Search" type="submit">
<input name="domains" value="www.little-truck.com" type="hidden">
<input name="sitesearch" value="www.little-truck.com" type="hidden">
</form>
Ordering domains and hosting
Here are the steps I do:
1. Create an account for the person (with their email and other info)
2. Add the appropriate hosting, domain registrations, etc. to a cart
3. Send them to https://www.securepaynet.net
4. Tell them to:
Click on "My Account"
Login with Account# xxx, password xxx
Click on "My Account", "Account Settings" and update your address or other info
Click on "My Cart" and "Checkout Now", purchasing registration and hosting
CVS Headaches
Found this answer (vague as it is): "The most common cause for this message is if you are using an external
rsh program and it exited with an error. In this case the rsh program should have printed a message, which will appear before the above message."So, I am downloading Xcode finally to see about just using the command line version (or maybe the GUI version needs the command line version as well?).
Updates to follow...
----------
Update:
While XCode has lots of cool stuff, it didn't fix MacCvsX.
Got rid of MacCvsX and instead went with Mac CVS Pro which worked with no problems.
Thursday, June 14, 2007
Photoshop Coolness
Here's my tutorial.
My day is ending on a very good note...considering I wrecked my brand new bicycle today.
Tuesday, June 12, 2007
Form element shows through layer
But I did get from it that all I had to do was hide the form field when I showed the div. Worked great! Once the project is live, I'll post the URL, but it's a Big Company with a scary NDA.
...code here...
this.tip.style.visibility = 'visible';
//this fixes the select box showing through the div problem
document.getElementById('id_name').style.visibility = 'hidden';
}
...code here...
this.tip.style.visibility = '';
document.getElementById('id_name').style.visibility = 'visible';
}
Fieldset in IE
The fieldset boxes were overlapping in IE; the answer is here. It has to do with adding {position:relative} and a margin to the fieldset attributes in the CSS.
Friday, June 1, 2007
"A" order
Note: a:hover MUST come after a:link and a:visited in the CSS definition in order to be effective!!
Note: a:active MUST come after a:hover in the CSS definition in order to be effective!!
Since I sometimes forget the order, so I'll put it here:
- link
- visited
- hover
- active
a:link, a:visited {
text-decoration: underline;
color: #6A5ACD;
background-color: transparent;
}
a:hover, a:active {
text-decoration: underline overline;
color: #191970;
background-color: #C9C3ED;
}Restarting Apache
I never looked under the hood of my various scripts.
Tuesday, May 29, 2007
Godaddy Reseller
Wednesday, May 9, 2007
Finds and greps and seds, oh my!
Here are commands I use intermittently but have to look up every time:
-Find in the current directory and recurse, in all files with a .html extension, the string "stuff to find", and print it to the screen:
find . -name '*.html' -exec grep 'stuff to find' '{}' \; -print
-Find in the current directory and recurse, in all files with a .html extension, the string "stuff to find", and replace it with "stuff to replace with"
grep -Rl 'stuff to find' * | grep .html$ | xargs sed -i '' -e 's/stuff to find/stuff to replace with/g'
Tuesday, May 8, 2007
Radio button styling in CSS
Here are a couple of the ways I found; the second one is stupidly complicated.
.htaccess file in OSX
But with a little closer look, I found that both my FTP program and my text editor can see hidden files even though OSX can't. Who needs to see files in Finder anyway? :)
And the point of this exercise was to get a client's HTML site parsing as PHP without changing the extension from .htm. Here's the snippet for the .htaccess file if you don't have control over the httpd.conf file:
RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html
Tuesday, April 24, 2007
Adwords
Subscribe to Posts [Atom]