I’ve decided to keep this blog for bigger picture stuff that all my clients can benefit from. My coding tips, and the geekiest of my thoughts, live here now.
New blog, meet old blog. Play nice now.
I’ve been using my main blog, http://petermahoney.net/blog for pretty much everything I’ve wanted to post about (that wasn’t only suited for the bowels of Facebook) and a bunch of quite developer specific posts were appearing.
I’ve decided to keep that blog for bigger picture stuff that all my clients can benefit from. My coding tips, and the geekiest of my thoughts, live here now.
Displaying code snippets easily
With the new site and all I’ve some CSS to get through.
I wanted to make the “pre” element work as a code snippet display for me, and needed a fix to get it to wrap text (since the “width” attribute has been defunct for some time).
Here’s the solution!
pre { background-color: #F2F2F2; padding: 5px 5px 5px 5px; white-space: pre-wrap; /* css-3 */ white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -o-pre-wrap; /* Opera 7 */ word-wrap: break-word; /* Internet Explorer 5.5+ */ }
Make a “Share on Twitter” link with URL and Hashtags
The link you have to make to share something to Twitter is quite simple:
http://twitter.com/share?text=text goes here
But getting a URL and hastag in there is a different matter. To be honest most developers do know how to include the URL, but hashtags have proved more elusive!
http://twitter.com/share?text=text goes here&url=http://url goes here&hashtags=hashtag1,hashtag2,hashtag3
Here’s an example to try out:
And that’s it!
Search Engine Optimisation (SEO), a primer
The number of people I see selling SEO services who really have no idea is appalling. (I’d say shocking, but there are a lot of opportunists out there!)
I’m going to break my series of SEO posts into the following sections:
- Code
- Site Speed
- Social integration
- Blogging
- Back-links and all other things link oriented
Naturally there is a lot of cross-over between them, but over the course of the series you’ll get a better idea of some key concepts, and some fairly original (but proven) ideas for their implementation.
All of course to get you more quality visitors!
Website code template
I have a small series of files I copy and paste whenever I’m about to start a new project, they have default templates for various files I use a lot. Like a header, footer, index page, blank stylesheet, and something called “top.php” that I use to open sessions and connect to databases.
There are also some of my standard folders pre-made too (with the correct server permissions) like “img” (images) and “upl” (uploads).
This was going to be last week’s #fridayfreebie, but here it is on a Wednesday instead.
This particular version is the one I use most commonly, and it’s set up for:
- PHP
- MySQL
- HTML5
- CSS (any version!)
- and ideally a unix/linux based server, because it references the top level of the site as being “/”.
I’ve zipped it up to share! Feel free to do whatever you want with it—although there is a lot of Peter Mahoney specific stuff in there, so you might want to take that out. Unless of course you like giving me credit for your work. 🙂
- « Previous Page
- 1
- …
- 51
- 52
- 53
- 54
- 55
- …
- 62
- Next Page »