References
Rule of thumb: Provide references so that the work is uniquely identified and easily accessible for readers (in case of online resources).
Academic resources
References to books or papers should consist of more than a link or a book name. Not only do links break eventually, they also require a click; the reference should be clear as is. This means that title, authors and year should be stated. If available, a link to an online version is great; use DOI if at all possible (such links survive moving resources).
Google Scholar is a great help for finding meta data and free copies of articles.
As for formatting, I like to use a style emulating articles:
I got this from CLRS [1] but Sedgewick's work [2] seems relevant.
---
1. [Introduction to Algorithms](http://mitpress.mit.edu/books/introduction-algorithms) by T. H. Cormen et al (2009, 3rd ed)
2. [Implementing Quicksort programs](http://dx.doi.org/10.1145/359619.359631) by R. Sedgewick (1978)
I got this from CLRS [1] but Sedgewick's work [2] seems relevant.
- Introduction to Algorithms by T. H. Cormen et al (2009, 3rd ed)
- Implementing Quicksort programs by R. Sedgewick (1978)
Remember that the official versions of articles are often paywalled (you may not notice if you surf from a university IP); if you know a preprint version, please provide a link to it as well (not only!). Please don't link knowingly to illegal resources, though.
For books, you should include at least title and authors (year published and edition would be helpful). For papers, you generally should include at least title, authors, and where it was published (e.g., conference name and year; or journal name, volume, and number).
Online resources
Cite with author, URL (prefer permalinks) and date of last access. You can use above scheme, or go inline like this:
[some article](http://hipblogginsite.com/hero/hype-topic-explained) by John Doe (accessed Jan 28, 2016)
Since websites usually go away (linking schemes break, domains change, sites are shut down, ...) and contents can change without notice (Wikipedia edits), make sure to quote the essential parts. Nobody wants to read dozens of pages in order to follow your post, so that's a good idea in any case.
If the website offers revisions (e.g. Wikipedia) you may want to link to the exact revision you are referencing. This is essential if you are asking about unclarities or suspected mistakes in the material, which will hopefully be fixed in the future and thus leave your question meaningless (unless you included the relevant passage as a quote, in which case a link to the revision is still a good idea).