• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

My Monkey Do

A Log of Coding Solutions

  • Home
  • Web Hosts
  • Tools
  • About

Use the Same Arg in Sprintf

June 14, 2011 by Webhead

When using sprintf you can use the same argument  like so:

sprintf(“You want the %1$s? You can’t handle the %1$s!”, “truth”);

The %1$s means it will pull from the first argument.

Filed Under: Coding Tagged With: php

MySQL UTF-8

June 12, 2011 by Webhead

Problem:

I have a database that needs to accommodate all languages.  Currently it is set to the default latin1_swedish_c1.  I’m thinking I need to change it to UTF8, but there are so many UTF8 encodings!

 

Solution:

“_cs” is for case sensitive collations.  So for case insensitive applications you can use utf8_general_ci.  utf8_bin is binary so it’s case sensitive.

 

Filed Under: Coding Tagged With: mysql

All Available Backups in MS SQL

June 10, 2011 by Webhead

In SQL Server 2008, to see all available db backups:

select * from msdb.dbo.backupset

Filed Under: Coding Tagged With: ms sql

I Don’t Always Test My Code

June 10, 2011 by Webhead

Filed Under: Random Thoughts

Spaces Between Images

June 9, 2011 by Webhead

Problem:

I can’t center the Image or there are spaces between my images.  If I delete the spacing in the code it goes away.  Why is this?

 

Solution:

img { display:inline}

If the img has no display attribute defined, the default display is inline.  This means that the image can be centered with text-align:center from an outer element.  However, if there is a space between images, it may show a space when it is displayed.  You can think of inline display as treating the image like text.

 

img {display:block}

If the img has a display:block attribute defined, the image cannot be centered with the text-align:center from an outer element.  The image will take up the full line so that the elements before and after will appear on a different line.  Because the image takes up the whole line, centering the image doesn’t have any effects.  Spaces between images also do not show because the image fills the whole line.

A nice explanation of inline vs block can be found here: http://www.webdesignfromscratch.com/html-css/css-block-and-inline/

Filed Under: Coding Tagged With: css

Image Optimization

June 7, 2011 by Webhead

Some great tools for optimizing images so that it downloads faster:

http://www.webdesignbooth.com/12-really-useful-image-optimization-tools-for-web-designers/

Filed Under: Off the Shelf Tagged With: optimize

  • « Go to Previous Page
  • Go to page 1
  • Interim pages omitted …
  • Go to page 33
  • Go to page 34
  • Go to page 35
  • Go to page 36
  • Go to page 37
  • Interim pages omitted …
  • Go to page 40
  • Go to Next Page »

Primary Sidebar

Topics

apache apple bootstrap buddypress chrome cloudways cms css debug drupal eCommerce firebug firefox git gmail goDaddy google hosting htaccess html html 5 IE crap image iPad iPhone javascript jquery kinsta linux localization mac os x ms sql mysql open source optimize php php 7.2 svg tinymce woocommerce wordpress wpengine xss yii youtube




Categories

  • Coding
  • Off the Shelf
  • Plugins
  • Random Thoughts
  • Server Stuff
  • Tools
  • Uncategorized