ourlil.com

A web site for tutti noi (all of us!)

  • Home
  • About
  • About – sample
  • Healing Christofer – Fun’-Raiser
    • Gallery
  • JP’s Page

Archive for the ‘coding’ Category

Let’s make the web faster – Google Code

Wednesday, June 24th, 2009

Let’s make the web faster – Google Code.

Some choice excerpts:

CSS: Using every declaration just once

Using every CSS declaration only once is an effective way to reduce file size of style sheets. It’s not a trivial optimization technique though: Watch over the cascade and adjust your editing workflow.

HTTP caching

Web pages can load much faster on repeated visits if the resources come from the cache. Learn about two groups of HTTP headers that make all the difference.

Optimizing web graphics

Optimizing your web illustrations, icons, and graphics is one of the simplest yet most effective ways to decrease your page load time. In this tutorial, we discuss image file formats and optimize some real Google graphics for faster download on the web.

Tags: CSS, HTML, images, js, optimization
Posted in Browsers, coding, javascript | Comments Off

Tutorials – Servers > Telnet as a Diagnostic Aid

Monday, February 16th, 2009

I don’t know about you, but I can use a reefresher now and again for things like surfing with Telnet to determine if 301 re-directs work…

In a nutshell, you’ll want something like this:

telnet eastvalley.freedomblogging.com 80[cr]
Trying 69.25.233.100…
Connected to eastvalley.freedomblogging.com.
Escape character is ‘^]’.
HEAD / HTTP/1.1[cr]
Host: eastvalley.freedomblogging.com[cr]
[cr]

Note: italic items are sent by the server, whilst non-italic items are typed. Also NOTE the double carriage return ([cr]) at the end.

Tutorials – Servers > Telnet as a Diagnostic Aid

Posted in Hacks, Unix, coding, nifty, tools | Comments Off

CSS Animation – iPhone Safari

Friday, February 6th, 2009

Surfin’ Safari – The WebKit Blog > CSS Animation

Something about a picture being worth a thousand words… Actually, it’s an animation, so you’d need a browser that supports it, and the iPhone’s Safari browser is the only ‘released’ browser that supports it at this time.


Posted in coding | Comments Off

Unicode and Character Sets plus MySQL Latin1 to UTF-8 Conversion

Tuesday, February 3rd, 2009

Binary DAD

I knew most of this… but alas, not all of it… BTW, here’s a relevant ThinkGeek.com present a friend gave me:

I found this interesting article on How To Change An Early WPMU Database from latin1 to utf8 Encoding, which has a bunch of useful links related to character encoding problems, WordPress (WPMU), and MySQL & PHP.

From the article in question:

So I have an announcement to make: if you are a programmer working in 2003 and you don’t know the basics of characters, character sets, encodings, and Unicode, and I catch you, I’m going to punish you by making you peel onions for 6 months in a submarine. I swear I will.

And one more thing:

IT’S NOT THAT HARD.

Binary DADIn this article I’ll fill you in on exactly what every working programmer should know. All that stuff about “plain text = ascii = characters are 8 bits” is not only wrong, it’s hopelessly wrong, and if you’re still programming that way, you’re not much better than a medical doctor who doesn’t believe in germs. Please do not write another line of code until you finish reading this article.

And then there’s this juicy tidbit:

For a while it seemed like that might be good enough, but programmers were complaining. “Look at all those zeros!” they said, since they were Americans and they were looking at English text which rarely used code points above U+00FF. Also they were liberal hippies in California who wanted to conserve (sneer). If they were Texans they wouldn’t have minded guzzling twice the number of bytes. But those Californian wimps couldn’t bear the idea of doubling the amount of storage it took for strings, and anyway, there were already all these doggone documents out there using various ANSI and DBCS character sets and who’s going to convert them all? Moi? For this reason alone most people decided to ignore Unicode for several years and in the meantime things got worse.

The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!) – Joel on Software

And some more:

Turning MySQL data in latin1 to utf-8 utf8

I’ve just finished one of the most difficult and tedious problems I’ve ever solved, so I have to share the solution here in a little tutorial of how I fixed this, even though I’m sure there are better ways, this is what worked for me.

THE PROBLEM – PART 1:
My old CD Baby MySQL database from 1998 was filled with foreign characters and was in MySQL’s default (latin1) encoding.
For years, customers and clients had been using our web interface to give us their names, addresses, song titles, bio, and many things in all kinds of alphabets.
I wanted everything to be in UTF-8. (The database, the website, the MySQL client, everything.)

QUICK DEFINITION : “FOREIGN CHARACTERS”
When I say “foreign characters” I mean not just Greek, Icelandic, Japanese, Chinese, Korean, and others shown at Omniglot, but also the curly-quotes, ellipsis, em-dash, and things described at alistapart.

And from AlexKing.org comes Fixing a MySQL Character Encoding Mismatch

We ran into an interesting MySQL character encoding issue at Crowd Favorite today while working to upgrade and launch a new client site.

Here is what we were trying to do: copy the production database to the staging database so we could properly configure and test everything before pushing the new site live. Pretty simple right? It was, until we noticed a bunch of weird character encoding issues on the staging site.

Character Encoding Issue

It turned out that while the database tables were set to a Latin-1 (latin1), the content that populated those tables was encoded as UTF-8 (utf8).

Tags: ANSI, ASCII, character set, encoding, MySQL, PHP, UTF-8, utf8
Posted in coding | Comments Off

Hacking IE CSS: Underscore, Box Model ‘Voice Family’, & Star hacks

Thursday, December 18th, 2008

CSS Hacks

Underscore Hack

/* CSS hack for IE 6 and below */
.test {
  position: fixed;
  _position: absolute;
}

Voice Family (Box Family or Tantek Hack)

/* CSS hack for IE 5.x */
.test {
  width: 500px;
  padding: 50px;
  voice-family: "\"}\"";
  voice-family: inherit;
  width: 400px;
}
html>body .test{
 width: 400px;
}

Backslash Hack

/* CSS hack for IE 5.5 and below */

.test {
  height: 500px;
  he\ight: 400px;
}

Commented Backslash Hack

/* begin hiding from IE5 Mac \*/
.test {
  color: red;
}
/* end */

And then there’s:

/* apply ONLY to IE5 Mac \*//*/
.test {
  color: red;
}
/* end */

High Pass Filter

/* CSS hack hides from browser which don't support @import */
  @import "null.css?\"\{";
  @import "highpass.css";



Posted in Hacks, coding | Comments Off

Even More Rounded Corners With CSS – Schillmania.com

Friday, October 31st, 2008

nice CSS rounded corners implementation

Even More Rounded Corners With CSS – Schillmania.com

And here’s the actual implementation and notes:

http://www.schillmania.com/projects/dialog2/

http://www.schillmania.com/projects/dialog2/download/20070214-even-more-rounded-corners.zip

Tags: CSS, radius, rounded corners
Posted in coding | Comments Off

JavaScript Get inner text -

Tuesday, October 28th, 2008

function GetInnerText(elem) {

return (typeof(elem.innerText) != 'undefined') ? elem.innerText :

(typeof(elem.textContent) != 'undefined') ? elem.textContent : elem.innerHTML.replace(/]+>/g, '');

}

Get inner text – Karamasoft Support Forums.

Posted in coding, javascript | Comments Off

JavaScript Get inner text -

Tuesday, October 28th, 2008

function GetInnerText(elem) {

return (typeof(elem.innerText) != 'undefined') ? elem.innerText :

(typeof(elem.textContent) != 'undefined') ? elem.textContent : elem.innerHTML.replace(/]+>/g, '');

}

Get inner text – Karamasoft Support Forums.

Posted in coding, javascript | Comments Off

RegExr: Online Regular Expression Testing Tool

Friday, September 26th, 2008

RegExr: Online Regular Expression Testing Tool

\be\w*

\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b is a more complex pattern. It describes a series of letters, digits, dots, underscores, percentage signs and hyphens, followed by an at sign, followed by another series of letters, digits and hyphens, finally followed by a single dot and between two and four letters. In other words: this pattern describes an email address.

Posted in WebTech, coding, tools, tutorial | Comments Off

Regular Expression Tools

Monday, September 8th, 2008

  • RegExr is an excellent web-based utility that helps you construct a RegEx query by showing you results in real time. Hits are highlighted as you write your expression. 
  • Regular Expression Tutorial - This regular expression tutorial teaches you every aspect of regular expressions. Each topic assumes you have read and understood all previous topics. So if you are new to regular expressions, I recommend you read the topics in the order presented.
  • tuaw tip regular expressions for beginners

Tags: expressions, find, regexp, regular, search
Posted in Unix, WebTech, coding, cool, guru, nifty | Comments Off

<< Previous

  •  

    March 2010
    S M T W T F S
    « Feb    
     123456
    78910111213
    14151617181920
    21222324252627
    28293031  
  • Pages

    • About
    • About – sample
    • Healing Christofer – Fun’-Raiser
      • Gallery
    • JP’s Page
  • Archives

    • February 2010
    • November 2009
    • August 2009
    • July 2009
    • June 2009
    • May 2009
    • March 2009
    • February 2009
    • January 2009
    • December 2008
    • October 2008
    • September 2008
    • August 2008
    • July 2008
    • June 2008
    • May 2008
    • April 2008
    • March 2008
    • February 2008
    • December 2007
    • October 2007
    • September 2007
    • August 2007
    • July 2007
    • June 2007
    • May 2007
  • Categories

  • Favorites

    Here're a few sites I like to visit:
    • WPMU.org
    • Holy Shmoly
    • AppleInsider.com
  • Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org

Copyright © 2010 - ourlil.com | Entries (RSS) | Comments (RSS)

WordPress theme designed by web design