Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" | |
| "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="et"> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
| <title>table</title> | |
| <style type="text/css"> | |
| .odd { background-color: #808080; } | |
| .generated_for_mobile { margin-bottom: 30px } |
| // Taken from the commercial iOS PDF framework http://pspdfkit.com. | |
| // Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved. | |
| // Licensed under MIT (http://opensource.org/licenses/MIT) | |
| // | |
| // You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it. | |
| // PLEASE DUPE rdar://27192338 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit. | |
| #import <objc/runtime.h> | |
| #import <objc/message.h> |
| { | |
| entries: [ | |
| {% for entry in craft.entries.find() %} | |
| { | |
| title: "{{ entry.title | e('js') }}", | |
| tags: [ | |
| {% for tag in entry.myTagsField %} | |
| "{{ tag.name | e('js') }}" {% if not loop.last %},{% endif %} |
| <?php | |
| // Get the entry | |
| $entry = craft()->entries->getEntryById(100); | |
| // Convert the existing data to what it would look like in POST | |
| $matrixData = array(); | |
| foreach ($entry->matrixField as $block) | |
| { |
Here are a few common tasks you might do in your templates, as they would be written in ExpressionEngine vs. Craft CMS.
| <?php | |
| public function getEntryJson(EntryModel $entry) | |
| { | |
| $entryData = array(); | |
| foreach ($entry->getType()->getFieldLayout()->getFields() as $field) | |
| { | |
| $field = $field->getField(); | |
| $handle = $field->handle; |
| #!/bin/bash | |
| # file: ttfb.sh | |
| # curl command to check the time to first byte | |
| # ** usage ** | |
| # 1. ./ttfb.sh "https://google.com" | |
| # 2. seq 10 | xargs -Iz ./ttfb.sh "https://google.com" | |
| curl -o /dev/null \ | |
| -H 'Cache-Control: no-cache' \ | |
| -s \ |
To make Micropub requests, the specification requires a Bearer token. Many current Micropub clients force the user to go through IndieAuth to obtain this, which means you need to have the required authorization and token endpoints set-up before getting started with Micropub.
The file token-provider.php implements the happy path for the IndieAuth dance resulting in providing the Micropub client with whatever token the user has provided.
raziellight on IRC was trying to get the Micropub client Omnibear to work, and that required him to figure out how to set-up IndieAuth from scratch. I think this is way too big of an investment for getting started with Micropub. It was time to cut out the middle man (or protocol, in this case