Quick tip to create a list page that will read the files from a directory and link to them is super easy. Using scandir to scan a folder then loop through the files and create a series of a links that link to the document.Continue Reading
For an upcoming project I need to be able to dynamically get information about a GitHub repository such as the number of stars, watchers, forks and the repo description and url.
Looking at the API I didn’t see a simple way of doing it so I decided to scrape my repo instead.
Using HTML Dom Parser (http://simplehtmldom.sourceforge.net) the process is simple. First include simple_html_dom.php then setup the url to my repo:Continue Reading
PHP's in_array is useful to determine if an item is in an array but when needing to compare multiple values against in_array no results will be found.
A way round this is to loop through the values and compare each one in turn, this function is pefect that that task.....Continue Reading
Sending HTML emails can be tricky, not all mail clients support the same css. Most ignore external stylesheets, inline styles are the only way to format layouts for maximum compatability.
Applying inline styles to elements can be hard to maintain, this is where Premailer comes in, Premailer can take a file or HTML markup and take any styles inside style tags and place them inside the tags as inline style attributes.
Premailer provides an api to allow usage within your applications. http://premailer.dialect.ca/api
The Premailer API is accessed via an HTTP POST to http://premailer.dialect.ca/api/0.1/documents.Continue Reading
Using HTTPS is recomended, Google also preferes HTTPS they recently announced: “HTTPS is a ranking signal. For now it's only a very lightweight signal—affecting fewer than 1% of global queries, and carrying less weight than other signals such as high-quality content—while we give webmasters time to switch to HTTPS. But over time, we may decide to strengthen it, because we’d like to encourage all website owners to switch from HTTP to HTTPS to keep everyone safe on the web.”Continue Reading