I AM LISTENING TO
|
WAS ICH LIEBE
  • Englisch
  • Deutsch


BLOG FILTER



6. April 2016

Detect browser language

 

readmore

Gisto is a code snippet manager that runs on GitHub Gists and adds additional features such as searching, tagging and sharing gists while including a rich code editor. All your data is stored on GitHub and you can access it from GitHub Gists at any time with changes carrying over to Gisto.“

The application is multi-platform.

Gisto

readmore
14. März 2016

iOS Apps for developers

IDE – Integrated development environment

  1. Koder is still my main solution, with a bunch of features I do not want to miss on the go.
    • Syntax Highlighting
    • Code Autocomplete
    • Code Function list
    • Access and Manage your Dropbox, (S)FTP, webdav and local files easily
    • Built In Terminal (SSH Client)
    • Built In Snippet Manager
    • Tabbed editing
    • Extra Keyboard with Custom Key
    • iOS8 Document Picker Support to open/import/export other app files from/to Koder
    • Find and replace code
    • Previewer Browser with Firebug Support + View Source function
    • Editor theme with Custom Theme Editor
    • Extra Key / Additional Keys on Virtual Keyboard with open+close brackets keys
    • Screen
    • Lock, Manual and Auto Lock
    • Extracting Zip File on Local project
    • Sophisticated File Browser
    • iOS „Open In“ support, from Koder to other app
    • vice versa
    • Change file/folder permission (CHMOD) on FTP/SFTP projects
    • Folder Synchronization between Local Project and FTP Project
    • Uploading files from desktop from browser or iTunes sharing
    • Expandable editing space
    • Bluetooth Keyboard Support
    • and many more
  2. DraftCode PHP IDE is a complete PHP and webserver environment that works offline on your iPad or iPhone
  3. Coda is powerful, and portable text editor.
    • A stunningly full
    • featured text editor
    • Works on both the iPhone or iPad
    • Editor features Clips, Find & Replace (with placeholder!), Context Keys, Super Loupe, much more.
    • Syntax highlighting for Apache, C, CSS, Diff, Go, Haml, HTML, INI, Java, JavaScript, LESS, Lua, Markdown, Perl, PHP, Python, Ruby, Sass, Scheme, Shell, SQL, Swift, XML and YAML
    • Local or Remote file management
    • Remote protocols include FTP, WebDAV, Amazon S3, DreamObjects, and FTP (Plain, TLS, SSL) support
    • Preview
    • Air Preview for use with Coda for Mac
    • Playgrounds
    • SSH Terminal
    • Much more!
  4. Textastic is an advanced code editor for iPad with support for syntax highlighting, (S)FTP and Dropbox.

FTP

  1. FTPOnTheGo – A desktop class, award winning FTP client
  2. iTransfer
  3. FTP Client Pro

SSH Terminal

  1. iTerminal – SSH Telnet Client
  2. SSH Terminal
  3. Serverauditor – SSH Shell / Console / Terminal

DOCUMENTATION

  1. Dash is an API Documentation Browser that gives your iPad and iPhone instant offline access to 150+ API documentation sets.

REPOSITORIES

  1. CodeBucket is the best way to browse and maintain your Bitbucket repositories on any iPhone, iPod Touch, and iPad
  2. Git2Go is the first app which unleashes your full development productivity from everywhere.
  3. GitLab Control is the best way to manage your GitLab projects on any iPhone, iPod Touch and iPad device

Enjoy coding …

 

readmore

JSON Formatter & Validator helps debugging JSON data, either data you wrote by hand or data that has been output in one compact line :)

JSON Formatter & Validator

readmore

Again another Google AMP article, this time dealing with Syntax Highlighting. If you have a code centric website, this is important.

In one of my last articles I talked about a Generic Syntax Highlighter.   This time I want to show you, how to add Syntax Highlighting with GeSHi to a custom template in AMP-WP.

FIRST SOME RESOURCES

Please read up on documentation, as I am not diving into every detail.

  1. AMP-WP – github.com/Automattic/amp-wp / Documentation
    The WordPress AMP integration. We will be using a custom template for our AMP pages.
  2. Crayon Syntax Highlighter github.com/aramk/crayon-syntax-highlighter
    I am using this for Syntax Highlighting on none AMP pages. It adds specific language classes to the code / pre areas, that I am using to configure GeSHi.
  3. GeSHi – github.com/GeSHi/geshi-1.0
    The Syntax Highlighter
  4. phpQuery – github.com/punkave/phpQuery
    DOM Document transversal & modification simplified. You should be able to apply the things below with any other tool as well.
  5. My tweaks on GitHub

ADDING GESHI TO AMP-WP

  1. Upload GeSHi and phpQuery to your desired location on your webserver.
  2. Call the custom template for AMP-WP in your functions.php

    I have an example stored on GitHub
  3. Create a custom template in your themes folder.We could use the following filters, but its easier to use the custom template, due to the GeSHi style setup. The problem is, that the style action is called before the content action within the template. But I am planning to build a TWIG template for myself, as I am running Timber everywhere. That will detach logic and content completely, allowing to rethink some of these things and make styling a lot easier :) So watch out for my next article!

    Add this to the top of your custom template:

    I have an example stored on GitHub. The above works, if you are using Crayon Syntax Highlighter for standard pages.
    If you use something else, this needs to be changed.
  4. Add the GeSHi styles to the amp-custom style tag


    I have an example stored on GitHub.
  5. Output updated amp-wp-content


    I have an example stored on GitHub.
  6. Save and check that your AMP page validates, by adding #development=1 to the end of the url. Check the console for errors.
    Show this page as AMP

Enjoy coding …

readmore

Due to Google AMP (Accelerated Mobile Pages) , I have been looking for a way to effectively do Syntax Highlighting without Javascript in pure PHP.

I was about to write my own, when I found an older article from phoboslab. Thanks Dominic for saving me some time ;) Its not perfect, but close enough.

A simple Syntax Highlighting Class that does just that. The class was not working with PHP 5.4.x+, as it uses  preg_replace() with the /e modifier.

It will not cover all, but its better than nothing :) I will also add a section to my my AMP tweaks article to showcase the integration of Geshi.

Here an updated version using the preg_replace_callback() function.

THE SYNTAX HIGHLIGHT CLASS

THE CSS

USAGE

@GitHub portalzine/UtilityBelt/SyntaxHighlight

Enjoy coding …

readmore

virtPHP is a tool for creating and managing multiple isolated PHP environments on a single machine. It’s like Python’s virtualenv, but for PHP.

virtPHP creates isolated environments so that you may run any number of PHP development projects, all using different versions of PEAR packages and different PECL extensions. You may even specify a different version of PHP, if your system has various installations of PHP.“

virtPHP @ Github

readmore
29. Februar 2016

AMP-WP Tweaks & Tips

The AMP (Accelerated Mobile Pages Project) plugin for WordPress is still pretty young and under heavy development.

There are little things that can help to fix current validation problems. I have a couple of fresh AMP pages, that are already indexed by Google.

0. RESOURCES


1. MISSING IMAGE (schema.org-NewsArticle)

The currently registered Microformats template (schema.org-NewsArticle) requires an image.
The AMP-WP documentation explains how to add a featured image to your pages (documentation).

I extended that a bit,  to link a default attachment image, I uploaded before. This needs to be added to your themes functions.php.

Next we adjust the Microformats definition. This needs to be added to your themes functions.php.


2. ADD YOUR OWN AMP TEMPLATE

Read the AMP-WP documentation first :) This forces AMP-WP to override the core template with your own. Use the default template as a reference.


3. REMOVE NONE VALIDATING CONTENT

Normally the core sanitizer should take care of that.  I am sure a filter will be added in the future. For now, this is a quick workaround. You can use a RegExp or DOMDocument to alter the amp-content in your custom template and filter things that break validation.

I am using phpQuery for now, as it allows me to add quick fixes. DOMNode or QueryPath works nicely as well :) Will be looking at the core sanitizer and options later this week. All of this is currently added to the custom template.

  1. Remove REL attributes that are not allowed. Only registered Microformat rel attributes are allowed.
  2. Remove attribute ALIGN
  3. Fix TARGET Attribute

Finally output the fixed content as HTML.

The above examples need to be tweaked to your specific content requirements.

The custom template „post_amp_content“ before:

The custom template „post_amp_content“ after:


4. ADD PREVIOUS & NEXT POST NAVIGATION

From the AMP specification :“Note, that AMP document may also be linked to directly…“

This is being added to the custom template as well.

Next:

Previous:


5. SYNTAX HIGHLIGHTING

You can find a simple pure PHP highlighter here. Not perfect, but a start. Don not forget to include the CSS :)

 

I will extend on this as new validation errors or tweaks come up. The core sanitizer of AMP-WP still needs some work and should allow us to do some of the above directly, when the content is parsed / converted for AMP.


 

 6. OTHER AMP ARTICLES

Make Syntax Highlighting work in AMP-WP using GeSHi

Time to get AMP ready

 

Enjoy coding …

 

readmore
26. Februar 2016

Time to get AMP ready

Google’s AMP is here to save us from slow mobile content delivery, by enforcing strict standards and limiting what is allowed within AMP pages. The pages only allow a subset of tags and introduce their own tags for fast prefetching of content (images, videos … AMP Specs)

THIS IS AMP

„The Accelerated Mobile Pages (“AMP”) Project is an open source initiative that came out of discussions between publishers and technology companies about the need to improve the entire mobile content ecosystem for everyone – publishers, consumer platforms, creators, and users.

Today, the expectation is that content should load super fast and be easy to explore. The reality is that content can take several seconds to load, or, because the user abandons the slow page, never fully loads at all. Accelerated Mobile Pages are web pages designed to load instantaneously – they are a step towards a better mobile web for all.“

AMP CACHE & VALIDATION

AMP pages are cached within the AMP Cache, providing even faster delivery of your content. The core libs validate your implementation and highlight any problems by pushing errors to the console.

INTEGRATION

The documentation lists all components currently supported within a page and experimental components in development as well.

  1. Introduction to AMP
  2. Video Introduction
  3. AMP for WordPress
  4. AMP Docs
  5. Q&A Video

I have already added AMP support to our blog posts:

  1. Standard page
  2. AMP page

Google’s Webmaster Tools also integrates a new section for AMP, to see how they perform.

WHAT AMP IS NOT

AMP is not supposed to replace your webpage, but offer a faster access point to presented content. It will not solve all use cases, but offer better performance for your simple reading pleasure for now. Its a start and lets see how it evolves ;)

Enjoy coding …

readmore

Simple way to do some Visual Composer Grid cleanup, when you are using Bootstrap within your theme. This removes and cleans up classes.

Visual Composer for WordPress
Bootstrap / Bootstrap Sass

Enjoy coding …

readmore