Archive for October, 2009
Nz-Mu
Thursday, October 29th, 2009
97x+S2 Kvieciamia visus prisijunkti rss
Free PHP Scripts | No Comments »
devendra
Thursday, October 29th, 2009
rss
Free PHP Scripts | No Comments »
151 Air, Web and iPhone Apps for Web Developers
Wednesday, October 28th, 2009
It seems like you can’t go two yards without bumping into apps these days. Whether it’s iPhone apps, web apps, or even Adobe Air apps – when used judiciously they certainly can boost your productivity and workflow. Of course over-apping has it’s dangers as my over encumbered Firefox will tell you! Still there is something mightily addictive about adding more and more awesome little tools to your arsenal.
On our sister blogs Web.AppStorm and Mac.AppStorm we’ve been running a series on apps and browser add-ons for web designers and developers. If that sounds like your cup of tea, be sure to head over and check out:
- 50 Air Apps and Browser Add-ons for Web Designers & Developers
- 51 Web Apps for Web Designers and Developers
- 50 iPhone Apps for Web Designers and Developers
And on the subject of over-apping, here’s a comic from Mac.AppStorm’s Mactastik strip:

learn, php, rss, tutorials
PHP Tutorials | No Comments »
Top 40 Tuts+ Tutorials in September
Wednesday, October 28th, 2009
In this Best of Tuts+ roundup you’ll learn how to simulate a sniper scope, design and code a flexible website, create an intense movie poster, create a golden vector compass, build a minigolf game with ActionScript 3.0, take sports photos like a pro, create a rocky video game terrain in Blender and get a useful introduction to home recording–among many other things! Let’s take a look.
Aetuts+ – After Effects Tutorials
-

Simulate a Realistic Sniper Scope Perspective – AE Plus
My tutorial deals with a VFX shot that’s easy to attempt but hard to master: A convincing looking sniper scope view.
I will outline the assets that I provide in Photoshop and the principles of accomplishing the intended outcome. In After Effects I’ll make use of pre-compositions, motion tracking and some easy expressions. For clarity’s purpose I’ll get into details about optical phenomena when necessary. -

Form a Unique Transition
In this tutorial we are going to reveal how to create a cool particle transition between 2 videos using Trapcode Form. We will cover the importance of layer maps while using this plugin as well as how to create a stylish displacement of the particles.
-

Making Your Color Scheme a Whole Lot Kuler!
Adobe Kuler is a great resource for color themes that is perfectly integrated in all Adobe CS4 software – except for After Effects. But this has changed now.
-

The Best Sound You’ll Ever See!
Satya is back with a new tutorial that will help you look as good as you sound. This technique has many options so sit back and learn how to create an attractive visual generated from your audio spectrum.
-

Terminate Your Footage With Expressions
Sep 21st in VFX by Ben McEwan If you’re wanting to help to save Sarah Connor then maybe this tutorial will give you an insider’s perspective on what to do. Ben McEwan has created a 3 Day Series crammed full of useful expressions to create the UI found in the Terminator.
Nettuts+ – Web Development Tutorials
-

11 Classic CSS Techniques Made Simple with CSS
We’ve all had to achieve some effect that required an extra handful of divs or PNGs. We shouldn’t be limited to these old techniques when there’s a new age coming. This new age includes the use of CSS3. In today’s tutorial, I’ll show you eleven different time-consuming effects that can be achieved quite easily with CSS3.
-

20 HTML Forms Best Practices for Beginners
Working with XHTML forms can be somewhat daunting; they not only use some niche HTML elements, but also blur the line between static content and user interaction. Let’s review some things to remember when creating your next form.
-

Search Engine Optimization 101
Your website may be top notch but what’s the use of an online presence if no one can find it? In this quick start guide to search engine optimization we’ll review an assortment of tactics to increase your page ranking.
-

How to Design and Code a Flexible Website
In this tutorial, we’re going to be designing and coding a simple blog-style web-page. We’ll pay special attention to making our design flexible and accessible by using clean and simple XHTML and CSS. This tutorial is aimed at beginners, and anyone looking to improve the accessibility of their web designs.
-

Getting Clean with PHP
Data security is important and often undervalued by designers, developers, and clients alike. Since PHP 5.2.0, data sanitization and validation has been made significantly easier with the introduction of data filtering. Today, we’re going to take a closer look at these filters, how to use them, and build a few custom functions.
Psdtuts+ – Photoshop
-

Render a Cereal Box Cover from Scratch Using Photoshop’s 3D Tools
Hi everyone! This time I’ve got for you a fun tutorial, we’ll create a cereal box design from scratch, using only Photoshop. We will render several fruit flavored cereal loops using the Photoshop’s CS4 Extended 3D tools, apply textures to the loops, bump the surfaces and mock-up them into a real 2D image. Are you ready?
-

Create a Big Air Event Poster with Photoshop and Illustrator – Psd Plus Tutorial
We have another Psd Plus tutorial exclusively available to Plus members today. If you want to take your Photoshop and Illustrator integration skills to the next level, then we have an exciting poster design tutorial for you. Learn more at the jump!
-

Create an Intense Movie Poster in Photoshop
Designers love to be critical about movie posters, and while you may think you have better ideas about how to sell a movie to an audience, how many times have you actually tried doing it? In this tutorial, we’re going to create a poster for a fictional movie called “Fugitive.” The movie is meant to be a suspenseful thriller that features one’s escape under the cover of darkness, despite man’s attempt to capture the lone hero. Thin and cheesy plot? Check. Awesome opportunity to better your PSD skills? You got it!
-

How to Create Eroded Metal Text with Photoshop
In this tutorial I’ll show you how to create an eroded metal text effect. Throughout this tutorial we’ll make use of various drawing techniques, channels, and patterns.
-

Add Fantastic Color to 3D Text – Part I
This is the first part of a two part series. Part two will be released tomorrow. In this piece you will learn how to bring a simple text to life and place everything in fantastic, colored and glowing 3D space. Some neat techniques covered here will allow you to bring your art to the next level. Don’t miss it! There are two parts to this tutorial: Part I and Part II.
Vectortuts+ – Vector & Illustrator
-

How to Create a Golden, Vector Compass in Illustrator
In this tutorial I will take you through the steps and techniques of creating a golden compass. For this tutorial I’ve used just Adobe Illustrator and a heavy dose of ingenuity.
-

How to Create a Yellow Submarine Icon with Gradient Meshes – Vector Plus Tutorial
We have another great Vector Plus tutorial available exclusively for Plus members today. If you want to learn how to use gradient mesh, pattern brushes and other advanced Illustrator tools to create a shiny submarine, then we have an awesome tutorial for you. Learn more about this tutorial at the jump!
-

Build a Promotional iPhone App Website Wireframe in Fireworks
Fireworks is a great tool for creating a wireframe and while it doesn’t work perfect with Photoshop, you can export over there and then build off your wireframe. We’ll cover the design process of creating a wireframe for an iPhone application website in Fireworks. For those of you not familiar with this program, it will be a good jumping off point for using it to wireframe your web design projects. This is a multi-part series and will be fun! Here is Part I of and Part II.
-

How to Create a Caramel Ripple Effect
In this tutorial, we will create a hot chocolate caramel effect using some distort tools and the 3D revolve tool. This is a simple and effective technique to obtain a quality vector ripple effect quickly. Here we go!
-

How to Create an Energy Saving Bulb in Illustrator
Here we’re showing how to create an energy saving bulb with the help of the Illustrator’s Mesh Tool. At the beginning it could be quiet hard to work with, but if you get used to it, it’s fairly simple.
Activetuts+ – Flash, Flex & ActionScript Tutorials
-

Create a Unit Converter Application for Flash Lite Enabled Devices
Flash Lite is an implementation of the Flash runtime for mobile phones, consumer electronic devices, and Internet-connected digital home devices. According to Adobe, the number of Flash Lite shipped devices will reach 1 billion in 2009 and more than 2.5 billion by the end of 2010, so if you are a Flash Developer it is important to know how this technology works and how it differs from Flash Player for the desktop.
In this tutorial I’ll guide you through the basics of Flash Lite using the 1.1 version; sacrificing features, but ensuring compatibility.
-

Build a Mini Golf Game with ActionScript 3.0
In this tutorial I´ll show you how to create nice Mini Golf Game with ActionScript 3.0. We´ll work with Event Handlers, Functions and also the Timer Object which is a really cool feature in AS3.
-

AS3 101: Loops
Welcome back to AS3 101, the fifth edition! At this point, you should be comfortable with the concepts of variables, functions, conditionals (branching), and Arrays. Not only should you be comfortable with the concepts, but you should also be fluent in how ActionScript 3 implements these concepts.
For this fifth episode, we’ll be adding to that catalog of skills the various looping structures found in AS3. You’ll find some dependencies on the information learned in AS3 101 Part 4, on Arrays, so if you’ve skipped that one or need a refresher, please review that tutorial before continuing with this one.
For our final project, we’ll combine loops and arrays, to make a simple shoot-em-up game.
-

Improve Your Memory With an Away3D Game
In this tutorial we’ll build a 3D memory game. Along the way we’ll look at adding variables and mouseEvents to Away3D objects. Let’s get started..
-

Build a Photo Viewer Using Flex and the Flickr API
In this tutorial you will learn how to use the as3flickrlib library to create a Flash Flickr photo viewer.
Phototuts+ – Photography & Post-Processing Tutorials
-

Photography Kick-start Guide: Adjusting Your Camera’s Settings for the Photo You Want
Cameras vary in terms of functions offered. There are differences from one brand to the next and even from one model to another of the same brand. By necessity, this tutorial will have to generalize but let’s try to de-mystify some of the more common settings found on cameras today, what they mean (to the camera) and how to use them.
-

Mastering the Art of Black and White Photography
In the early days of photography, photographers had no choice but to shoot in black and white, as it was the only available medium. Then, in 1936, the invention of kodachrome gave colour photography to the world. But black and white photography didn’t die off, instead it flourished. Modern black and white photography at it’s best is art, and many photographers regard it as the purest form of photography.
-

Freezing Time: 80 Inspiring Examples of High Speed Photography
In our last roundup, we covered a selection of amazing HDR images. This time we move onto something completly different, with stunning high speed photography. These images freeze time, and allow us to observe scenes that the naked eye would struggle to capture. It’s definitely worth a look for some great inspiration!
-

8 Tips for Taking Sports Photos Like a Pro
Are you looking to shoot better sports photos, and make an impact? Sports photography presents you with many opportunities to capture dramatic and vivid imagery that will last a lifetime. No other medium presents you with heart-pounding action, vivid color patterns and unique shooting opportunities.
The steps and guidance featured in this tutorial cover a broad range of areas – from perfecting shutter speed, to making sure you don’t miss the action. -

How to Photograph Waterfalls
Waterfalls are some of the most beautiful natural features you will ever get the opportunity to photograph. But though they can look simply stunning, photographing waterfalls is not easy to do well. How do you avoid your photos being too dark? How do you deal with clipping in the water? How do you compose your photos to capture the authentic beauty of the scene?
In this tutorial, nature photography expert Steve Berardi shares his best tips for photographing waterfalls.
Cgtuts+ – CG Tutorials
-

Model and Texture a Posh Living Room Scene in Maya
In this tutorial you will go through the process of modeling and rendering a Living Room in Autodesk Maya. You will also learn to use Mental Ray (along with the new architectural materials), create realistic fur, and implement studio lighting to create nice and soft shadows and highlights.
-

Using Splines to Add Detail to Your High-Poly Model in 3ds Max
Splines are an often-overlooked aspect of 3ds max when it comes to game art. Most people know that you can use a spline for a wire – but you can also use it for things like grooves, whole objects like handles, and even text! In this tutorial, we’ll take a look at some of these advanced ways that splines can be used to save a lot of time on tasks that would otherwise have to be done by hand.
-

Create a Rocky Video Game Terrain in Blender
In this series of tutorials you will learn how to create a finished environment for Blender’s Game Engine. The main focus of the series will be texturing and lighting, with the use of some custom 2d filters to enhance the result.
-

Model a Photorealistic Swiss Army Knife in Modo
Subdivision modeling is an extremely powerful tool that can allow you to add high levels of detail to your models in a relatively short amount of time. In order to use it effectively, however, one must know when, and more importantly, when not to use it. In this three part, beginner to intermediate tutorial series, professional Modo artist, Matt Braeley, will demonstrate how to model a photorealistic Swiss Army knife, using polygonal and subdivision modeling in Luxology’s Modo 302.
-

Build an Advanced Drifting Car Rig in 3ds Max
In this advanced level tutorial, you will learn all of the steps necessary to build a fully functioning car rig in 3D Studio Max. This rig features working suspension, steering and body roll, as well as some functionality for drifting and powerslides. You will learn how to set up internal functionality through links, constraints, expressions, and parameter wiring. The final result will be a robust rig with easy, and accessible controls.
Audiotuts+ – Audio and Music
-

Introduction to Polyrhythms
The usage of simple, common time (4/4 time signature, where there are four beats to a measure, and each quarter note gets one beat) is pervasive in Western popular music, including rock, blues, country, folk, pop, and various forms of electronic music including many sub-genres of house and trance music. The four-on-the-floor mindset can be difficult to escape, but every musician and composer can benefit from a study of rhythm that includes a wider variety of time signatures and rhythms.
-

How to Design Reeses and Hoovers
Have you ever wondered how your favourite dance music producers create those amazing sounds that make you jump on the dance floor? Well, it usually takes a lot of experience and a huge amount of time spent on experimenting and processing sounds a ridiculously high number of times.
But it’s quite hard to reach the stage of experimentation if you don’t even know the basics behind some kind of sounds often heard in dance tracks. This tutorial will teach you how to design from scratch a DnB trademark, the reese bass, and how to reproduce the infamous hoover sound, introducing you to the technique of resampling.
-

A Beginner’s Introduction to Home Recording
Home recording technology seems to get better and cost less every year. It puts power in the hands of ordinary people. You’ve probably found this article because you want to get into home recording.
Most of our tutorials here at Audiotuts are at the intermediate or advanced level. And that’s OK, because you won’t be a beginner forever. But we do have some more basic tutorials and articles aimed at the beginner. This article will refer to many of them, and hopefully give you an overview of what’s involved in getting into home recording.
-

A Basic Guide to Subtractive Synthesis (Part 1)
This screencast is the first tutorial in a series on synthesis. This first installment shows a basic guided tour of Subtractor in Reason and covers oscillators, filters and envelopes.
-

Is the Public Capable of Recognizing Quality Music?
Can the average music listener recognize quality? Can they distinguish a virtuoso from a mediocre musician? Can they recognize a “hit” that will still be esteemed a masterpiece in a hundred years? Does “popular” mean the same as “quality”?
learn, php, rss, tutorials
PHP Tutorials | No Comments »
Secure SMTP client
Wednesday, October 28th, 2009

It can connect to a given SMTP server using SSL or TLS, and authentication using the LOGIN method.
It can send send a message with a given subject from a given address to a given recipient.
classes, rss
Classes | No Comments »
WordPress as a CMS: New Plus Tutorial
Wednesday, October 28th, 2009
When most people think about WordPress, they think about blogs. If you look at the front page of WordPress.org, they talk a lot about blogging as well. What they don’t tell you is that WordPress can also double as a very powerful CMS; you just have to set it up properly. It can be a bit tricky to get setup and working the way that you want; but this is where I come in.
In this 3-part tutorial + screencast series, I’m going to take you through the three steps of using WordPress as a CMS. Become a PLUS member.
Join Tuts Plus

For those unfamiliar, the family of TUTS sites runs a premium membership service called “TUTSPLUS”. For $9 per month, you gain access to exclusive premium tutorials, screencasts, and freebies from Nettuts+, Psdtuts+, Aetuts+, Audiotuts+, and Vectortuts+! For the price of a pizza, you’ll learn from some of the best minds in the business. Join today!
- Subscribe to the Nettuts+ RSS Feed for more daily web development tuts and articles.
learn, php, rss, tutorials
PHP Tutorials | No Comments »
Easy Version Control with Git
Wednesday, October 28th, 2009
Have you ever worked on a project that was so unwieldy, you were scared to update a file or add a feature? Maybe the problem was that you weren’t using a version control system. In today’s tutorial, we’ll learn the basics of what might possibly be the best VCS in the world: Git.
What is Git?
Git is a open-source code managemen tool; it was created by Linus Torvalds when he was building the Linux kernel. Because of those roots, it needed to be really fast; that it is, and easy to get the hang of as well. Git allows you to work on your code with the peace of mind that everything you do is reversible. It makes it easy to experiment with new ideas in a project and not worry about breaking anything. The Git Parable, by Tom Preston-Werner, is a great introduction to the terms and ideas behind Git.
Why Should I use Git?
You should definitely use a revision control system; as we already said, this gives you the freedom to do whatever you want with your code and not worry about breaking it. So if you’ve realized the benefits of using a revision control system, why should you use git? Why not SVN or Perforce or another one? To be honest, I haven’t studied the differences too closely; check out WhyGitIsBetterThanX.com for some helpful info.
How do I Get Set Up?
Git is pretty easy to get: on a Mac, it’s probably easiest to use the git-osx-installer. If you have MacPorts installed, you may want to get Git through it; you can find instructions on the GitHub help site. (And yes, we’ll talk about GitHub). On Windows, the simplest way to start rolling is to use the msysgit installer. However, if you’ve got Cygwin, you can git Git through there as well.
How do I use Git?
By now you should have Git installed; if you’re on a Mac, open up a terminal; if you’re on Windows open the Git Bash (from msysgit) or your Cygwin prompt. From here on, there shouldn’t be any OS differences.
Configuration
We’ll start by doing a bit of configuration. Every commit you make will have your name and email address to identify the ‘owner’ of the commit, so you should start by giving it those values. To do so, run these commands:
git config --global user.name "Your Name" git config --global user.email "your@email.com"
It’s also nice to enable some text coloring, just for easier reading in the terminal.
git config --global color.diff auto git config --global color.status auto git config --global color.branch auto
git init
Now that Git knows who you are, let’s imagine we’re creating a simple PHP web app. (Of course, the bigger the project, the brighter Git shines, but we’re just learning the tools, right?) We’ve got an empty directory called ‘mySite.’ First focus on that directory (using the cd command). To get started with Git, you need to run the git init command; as you might guess, this initializes a Git repository in that folder, adding a .git folder within it. A repository is kind of like a code history book. It will hold all the past versions of your code, as well as the current one.

Notice that your terminal path is appended with (master). That’s the branch you’re currently working on. Branch? Think of your project as a tree; you can create different features on different branches, and everything will stay separate and safe.
git add
We’ve started working on our application.

Before we go any further, we should make our first commit. A commit is simply a pointer to a spot on your code history. Before we can do that, however, we need to move any files we want to be a part of this commit to the staging area. The staging area is a spot to hold files for your next commit; maybe you don’t want to commit all your current changes, so you put some in the staging area. We can do that by using the add command
git add .
The . simply means to add everything. You could be more specific if you wanted.
git add *.js git add index.php
git commit
Now that we’ve staged our files, let’s commit them. This is done with the command
git commit
This takes all the files in our staging area and marks that code as a point in our project’s history. If you don’t add any options to the command above, you’ll get something like this.

Each commit should have an accompanying message, so you know why that code was committed. This editor allows you to write your message, as well as see what is in this commit. From the image above, you can see that this commit is comprised of four new files. The editor you’re using to write the message is Vim; if you’re not familiar with vim, know that you’ll need to press i (for Insert) before you can type your message. In the shot above, I’ve added the message “Initial Commit.” After you write your message, hit escape and type :wq (to save and exit). You’ll then see you’re commit take place.

You can use a few options to make commits more quickly. Firstly, -m allows you to add your message in-line.
git commit -m "initial commit"
Then, -a allows you to skip the staging area; well, not really. Git will automatically stage and commit all modified files when you use this option. (remember, it won’t add any new files). Together, you could use these commands like this:
git commit -am 'update to index.php'
So how does Git tell commits apart? Instead of numbering them, Git uses the code contents of the commit to create a 40 character SHA1 hash. The neat part about this is that, since it’s using the code to create the hash, no two hashes in your project will be the same unless the code in the commits is identical.
git status
The git status command allows you to see the current state of your code. We’ve just done a commit, so git status will show us that there’s nothing new.

If we continue working on our imaginary project, you’ll see that our status changes. I’m going to edit our index.php and add another file. Now, running git status gives us this:

The update is divided into two categories: “changed but not updated,” and “untracked files.” If we run
git add userAuthentication.php git status
you’ll see that we now have a “changes to be committed” section. This lists files added to the staging area. I’m going to commit these changes with this:
git commit -am 'user authentication code added'
Now running git status shows us a clean working directory.
git branch / git checkout
Here’s a scenario: we’re working happily on our project when suddenly we have a grand idea. This idea is so revolutionary, it will change our project drastically. We’ve got to give it a try, but we don’t want to throw this insecure, first-draft code in with our tested and true code. What to do? This is where git branch will be immensely helpful. Let’s branch our project so that if our big idea doesn’t work out, there’s no harm done.
git branch
Just running the branch command sans options will list our branches; right now, we’ve only got the master branch, which is what any git repository starts with. To actually create a new branch, add the name of your new branch after the command.
git branch bigIdea
When you create a new branch, you aren’t switched to it automatically. Notice that our terminal still says (master). This is where we use branches comrade command git checkout.
git checkout bigIdea

(Tip: you can create a branch and switch to it in one fell swoop with this command: git checkout -b branch name.) As you can see, we’re now on the bigIdea branch. Let’s code up a storm. Git status will show our work.

Let’s commit our changes:
git add . git commit -m 'The Kiler Feature added'
All right, enough of this feature for now; let’s go back to our master branch; but before we do, I want to show you our current project folder.

Now, switch back to the master branch; you know how:git checkout master. Look at our project folder again.

No, I didn’t do anything; those two files are only part of the bigIdea branch, so we don’t even know they exist from the master branch. This not only works for complete files, but also for even the smallest changes within files.
git merge
Ok, so we’ve been working hard on that bigIdea branch in our spare time. In fact, after another commit, it’s looking so sweet we’ve decided it’s good enough to join the master branch. So how do we do it?
The git merge command is made for exactly this purpose. While on the master branch, give this a try:
git merge bigIdea
It’s that easy; now, everything on the bigIdea branch is a part of the master branch. You can get rid of the bigIdea branch now, if you want.
git branch -d bigIdea
I should mention that if you haven’t merged a branch, Git won’t let you delete it with this command; you’ll need to use an uppercase D in the option. This is just a safety measure.
git log / gitk
You’ll probably want to look at your commit history at some point during your project. This can easily be done with the log command.
git log
This will output a list of all the commits you’ve made in a project, showing them in reverse order. You can get at quite a tidy chunk of info here:
- the commit author
- the commit hash
- the date and time
- the message

Definitely informative, but rather dry, no? We can brighten things a bit with the graph option.
git log --graph

Now we can see the tree structure, sort of. Although we don’t get their names, we can see each of the branches and which commits were made on them. If you’re used to working in a terminal, you might be fine with this. However, if (previous to this experience) the word terminal strikes you first as something deadly, breathe easy: there’s an app for that. Try this:
gitk --all

This is the graphical repository browser. You can browse around your commits, see exactly what was changed in each file during a commit, and so much more. (You’ll notice I added a few commits before merging, just to make the tree structure more recognizable.)
GitHub
Now that you’ve got a reasonable knowledge of Git under your belt, let’s look at some of the collaborative parts of Git. Git is a great way to share code with others and work on projects together. There are a number of Git repository hosting sites. We’ll just look at one: GitHub.


Head over to the GitHub sign-up page and create an account. You’ll need an SSH public key, so let’s create that right now! (Note: you don’t need the key while signing up; you can add it later.)
Open up your terminal and type this:
ssh-keygen -t rsa -C "your@email.com"

The t option assigns a type, and the C option adds a comment, traditionally your email address. You’ll then be asked where to save the key; just hitting enter will do (that saves the file to the default location). Then, enter a pass-phrase, twice. Now you have a key; let’s give it to GitHub.
First, get your key from the file; the terminal will have told you where the key was stored; open the file, copy the key (be careful not to add any newlines or white-space). Open your GitHub account page, scroll to SSH Public Keys, and click “Add another public key.” Paste in your key and save it. You’re good to go! You can test your authentication by running this:
ssh git@github.com
You’ll be prompted for your pass-phrase; to avoid having to type this every time you connect to GitHub, you can automate this. I could tell you how to do this, but I’d probably inadvertently plagiarize: the GitHub Help has a plain-english article on how to do it.
Git Clone
So now you’re set up with GitHub; let’s grab a project. How about jQuery? If you go to the jQuery GitHub project, you’ll find the git clone URL. Run this:
git clone git://github.com/jquery/jquery.git

This creates a jquery folder and copies the whole jquery repository to your computer. Now you have a complete history of the project; check it out with gitk –all.
git push
So let’s say you’ve been working on a project, managing it with git locally. Now you want to share it with a friend, or the world. Log into GitHub and create a new repository. GitHub will give you a public clone URL (for others wanting to download your project) and a personal clone URL (for yourself).

Then, come back to your project in the terminal and give this a whirl:
git remote add origin git@github.com:andrew8088/Shazam.git
A remote is a project repository in a remote location. In this case, we’re giving this remote a name of origin, and handing it our private clone URL. (Obviously, you will have to substitute my URL for your own.) Now that the project knows where it’s going . . .
git push origin master

This pushes the master branch to the origin remote. Now you’re project is available to the world! Head back to your project page and see your project.

git pull
You might be on the other end of a project: you’re a contributor instead of the owner. When the owner pushes a new commit to the repository, you can use git pull to get the updates. Git pull is actually a combo tool: it runs git fetch (getting the changes) and git merge (merging them with your current copy).
git pull
You’re Set!
Well, there’s so much more you can learn about Git; hopefully you’ve learned enough commands to help you manage your next project more smartly. But don’t stop here; check out these resources to become a Git master!
- Git, GitHub, and Social Coding (YUI Theater)
- GitHub Learning Center
- Gitcasts.com: screencasts on Git
- The Git site
- My public Git Evernote-book
- Follow us on Twitter, or subscribe to the Nettuts+ RSS Feed for the best web development tutorials on the web.
learn, php, rss, tutorials
PHP Tutorials | No Comments »
Chatr - simple Ajax/Php chat
Wednesday, October 28th, 2009
Another simple ajax chat application with limited functionality built in PHP rss
Free PHP Scripts | No Comments »
Plugin Compatibility Beta
Wednesday, October 28th, 2009
The number one reason people give us for not upgrading to the latest version of WordPress is fear that their plugins won’t be compatible. As part of our continuing efforts to make WordPress core, plugin, and theme upgrades as painless as possible, Michael Adams developed and launched a beta of a new “Compatibility” feature in the plugin directory, powered by your votes. When viewing a plugin in the directory, select a WordPress version and a plugin version from the drop-downs. If there has been feedback about this WordPress / plugin version combination, we’ll show you what percentage of responses marked that combination as compatible vs how many marked it as incompatible.

If you log in, you’ll be able to help us gather this information! Just select a WordPress version / plugin version combination and click the “Works” or the “Broken” button. Please note that this shouldn’t be used to report minor issues with a plugin. You should mark a plugin as “Broken” only if its core functionality is truly broken when run on the specified WordPress version.

Right now we’re just in information gathering mode. So get out there and vote! Don’t just vote on broken plugins… cast a “Works” vote for every plugin that works on the version of WordPress you are using. This can help improve the signal-to-noise ratio in our data and prevent a few mistaken “Broken” votes from weighing too heavily.
For developers, we’re now including this data in our API. The plugin_information action now returns a “compatibility” member with the multidimensional array format:
array( {WP version} => array( {plugin version} => array( {% of reporters who say it works}, {# responses} ) ) )
If the API knows which version of WordPress you are using (for example, if you are making this query using the plugins_api() function from with WordPress), the API will only return compatibility information for your version of WordPress.
Eventually, we’d like to gather this compatibility feedback from within WordPress, allowing you to vote directly from your plugins admin screen. The ultimate goal is to use this information to inform you of plugin incompatibilities with a new version of WordPress during the upgrade process. For that to be useful we need a large set of high quality compatibility data. Start voting!
rss
Uncategorized | No Comments »
Feeds 101
Tuesday, October 27th, 2009
Feeds. RSS. Atom. Syndication. Subscribers. These are some of the keywords floating around the web and have gained notorious prominence over the years. In this guide, we’ll take a look at a number of things including what feeds are, why you need to have a feed for your site, how to set up one and then publish it.
What are Feeds?

In this digital age, users no longer have the luxury of time to check for new content manually each time or more importantly remember each site they want to get information from. Web feeds, news feeds or feeds helps the user simplify this process drastically.
Feeds, to put it simply, are a way to publish frequently updated content. Your feed is a XML formatted document which lets you share content with other users on the web. Users, subscribers in this lingo, can use your feed to read updated information on your site if and when it is posted.
Why you Should Publish Feeds
From a web developer’s perspective, one of the main reason for publishing a feed is user convenience. With a feed for users to subscribe to, they don’t have to check for new content manually each time. They can just subscribe to your feed and get notified new content is posted. No hassles! If you fear you’ll lose your advertisement revenues in this process, you can just as easily include ads in the feed.
Publishing a feed also means that it is easier for third party content providers to syndicate your content thus gaining more exposure and traffic in the process.
Feed Formats
As with any hot technology, there are a few well established, competing protocols for creating web feeds.
RSS

RSS is the dominant format for publishing web feeds and stands for Really Simple Syndication. RSS has a number of variants each branching out from RSS 1.x and RSS 2.x versions. A lot of services, including WordPress use RSS for creating its feeds.
Despite it’s massive user base, RSS does suffer from some drawbacks, some significant, the most important one being its inability to handle HTML. Nevertheless, we’ll be creating our feed today in the RSS format.
Atom

Atom was created in order to mitigate a lot of RSS’ drawbacks including the ability to include properly formatted XML or XHTML in your feeds. But since RSS has almost become synonymous with feeds, Atom has always been the much more feature rich and flexible little brother.
RSS’s Format
In the interest of keeping it simple, we’ll just stick with RSS today instead of trying out each format out there.
Each and every RSS feed out there follows this general format:
Defining the version and encoding
RSS is a subset of XML which means we need to make sure it is marked so appropriately.
<?xml version="1.0" encoding="utf-8"?> <rss version="2.0"> .. </rss>
The first line is the XML declaration. We define the version so that it validates correctly as XML. The encoding part is purely optional.
The second line defines the version of RSS we are going to use today. We are going to use RSS 2 today.
Each feed need to be inside a channel so that goes inside the markup. Thus far our feed looks like so.
<?xml version="1.0" encoding="utf-8"?> <rss version="2.0"> <channel> .. </channel> </rss>
Filling in the feed’s source information
This is where you fill in all the important details like the name of the feed, the URL and a description of the site.
<title>My feed</title> <link>http://www.somesite.com</link> <description>Random ravings</description>
You aren’t limited to these fields alone. There are a number of other optional fields including the language of your feed, an image for the logo, when the feed was updated last and many more.
Adding the content
Each item in the feed has to be enclosed by an <item> element. An item can be anything: a news post, a status update, new products: anything. Each item requires a title and a corresponding link. As with before, you can make use of a number of optional elements including description and author fields.
A sample item would look like so:
<item> <title>Feeds 101</title> <link>http://www.net.tutsplus.com</link> <description>Let's create an RSS feed from scratch!</description> <author>Siddharth</author> </item>
Building a Static RSS Feed
Now that we know all the individual parts of a RSS file and how they all gel together, it’s time to see a complete RSS file.
<?xml version="1.0" encoding="utf-8"?> <rss version="2.0"> <channel> <title>My feed</title> <link>http://www.somesite.com</link> <description>Random ravings</description> <item> <title>Feeds 101</title> <link>http://www.net.tutsplus.com</link> <description>Let's create an RSS feed from scratch!</description> <author>sid@ssiddharth.com</author> </item> </channel> </rss>
It may not look like much but gents, this is a working RSS feed. We’ve defined everything that needs to be defined and if you are inclined to do so, you can put this on the web.
Building a Dynamic RSS Feed
Happy about building your first RSS feed? You should be! But the problem with this is that the feed is completely static: something which is completely counter intuitive as compared to the concept of feeds. We’ll rectify this now by building a simple PHP script that mooches off data from a database and updates the RSS feed when needed.
Since I like having pretty URLs, I am going to name this file index.php and place it in a folder called feed so my feed can be accessed at www.mysite.com/feed
For the sake of simplicity, I am going to assume you already have a database containing your articles. I am also assuming the database has columns named title>, link, description and date in a table called posts.
Building the base
<?xml version="1.0" encoding="utf-8"?> <rss version="2.0"> <channel> <title>My feed</title> <link>http://www.somesite.com</link> <description>Random ravings</description> <?php // Code here ?> </channel> </rss>
Since the XML declarations and feed information are going to be pretty static, we’ll keep them static. You’d want to keep them dynamic if you were writing a PHP class for generating RSS feeds but for our purposes, this should do.
Defining database information and connecting
DEFINE ('DB_USER', 'some_username');
DEFINE ('DB_PASSWORD', 'some_unusually_weak_password');
DEFINE ('DB_HOST', 'localhost');
DEFINE ('DB_NAME', 'database');
Simple as it looks. We just note down a bunch of information for use later.
$connection = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD) or
die('Connection to the specified database couldn't be established');
mysql_select_db(DB_NAME) or
die ('Specified database couldn't be selected');
Pretty generic connection code. We try to connect using the credentials noted earlier. If nothing hitches up, we select the relevant database for use later.
Querying the database
$query = "SELECT * FROM posts ORDER BY date DESC";
$result = mysql_query($query) or die ("Query couldn't be executed");
This isn’t really a SQL oriented tutorial and so I’ll skim over it. We just grab all the posts from the table so that we can add it to the feed. Nothing else fancy going on over there.
Populating the items list
while ($row = mysql_fetch_array($result, MYSQL_ASSOC) {
echo '<item>
<title>'.$row['title'].'</title>
<link>'.$row['link'].'</link>
<description>'.$row['description'].'</description>
</item>';
}
We grab each individual record and then print it inside the relevant element to create the items list. Note that since I wanted a hash to work with I set the result type to MYSQL_ASSOC.
And with that the PHP part is done. The complete code should look like below.
<?php
header("Content-Type: application/rss+xml; charset=utf-8");
?>
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>My feed</title>
<link>http://www.somesite.com</link>
<description>Random ravings
</description>
<?php
DEFINE ('DB_USER', 'some_username');
DEFINE ('DB_PASSWORD', 'some_unusually_weak_password');
DEFINE ('DB_HOST', 'localhost');
DEFINE ('DB_NAME', 'database');
$connection = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD) or
die('Connection to the specified database couldn't be established');
mysql_select_db(DB_NAME) or
die ('Specified database couldn't be selected');
$query = "SELECT * FROM posts ORDER BY date DESC";
$result = mysql_query($query) or die ("Query couldn't be executed");
while ($row = mysql_fetch_array($result, MYSQL_ASSOC) {
echo '<item>
<title>'.$row['title'].'</title>
<link>'.$row['link'].'</link>
<description>'.$row['description'].'</description>
</item>';
}
?>
</channel>
</rss>
You should now be able to access your feed at www.yoursite.com/feed.
Validate your Feed

Just like with xHTML, RSS/XML needs to be well-formed and without errors. There are a number of validators to help you with this. Here are some of my often used ones.
Since RSS can only handle escaped HTML, make sure you use < lt; for < and < gt; for > respectively. Also make sure you replace special characters to their respective HTML codes. Forgetting to do so will probably result in invalid markup and break the feed.
All Done! Publish that Feed

Now that we’ve created the feed and made sure it validates, we can now go publish it. You can use a service like Feedburner to manage your feeds. This lets you glean a lot of information including how many subscribers you have. Or you can take the easy way out and just link to your feed on your site.
Have you ever noticed the feed icon on your browser lighting up for certain pages alone? This means the browser has been notified that a feed of the current page is available for subscription. In order for the user’s browser to automatically detect the feed’s presence you need to add this small snippet to the head section of your page:
<link rel="alternate" type="application/rss+xml" title="Article RSS Feed" href="http://www.yoursite.com/feed" />
You need not limit yourself to one feed. You may have a feed for each author or a feed for each category of the products you sell. Feel free to add as many feeds you want to the head section.
Conclusion
And that brings us to an end to this joy ride. We’ve gone over what feeds are, what purpose they serve and the different formats available. Next we looked at RSS, its skeleton structure and then learned how to create a simple dynamic RSS feed. Hopefully you’ve found this tutorial interesting and this has been useful to you.
Questions? Nice things to say? Criticisms? Hit the comments section and leave me a comment. Happy coding!
- Follow us on Twitter, or subscribe to the Nettuts+ RSS Feed for the best web development tutorials on the web.