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


BLOG FILTER



I am currently developing a drag and drop interface for a course builder. Courses are split into lessons and lessons into slides. While switching between slides, I wanted to have a small thumbnail representing the current slide content.

One option would have been to use something like PhantomJS / CasperJS.  A headless browser , to take a screenshot of the slide. I have done that in the past and it works perfectly.

This time, I decided to go with another solution, that allows me to convert html to a canvas element.

The project is called html2canvas (GitHub).

„This script allows you to take screenshots of webpages or parts of it, directly on the users browser. The screenshot is based on the DOM and as such may not be 100% accurate to the real representation as it does not make an actual screenshot, but builds the screenshot based on the information available on the page.“

EXAMPLE

CANVAS TO BACKGROUND IMAGE

I have a slide container (#slideContainer), that holds the active slide for editing and a thumb navigation to switch between slides (.slide.thumb).

When switching between slides, I am doing a snapshot of the current slideContainer and add it as a new background image to the thumb navigation item for that slide. This is done with canvas.toDataURL() and by embedding the resulting image  using a data: url.

Works perfectly. html2canvas has no full css support, so the output will not always match 100%, but its close enough to get a glimpse of what is stored per slide ;)

html2canvas
PhantomJS
CasperJS

Enjoy coding …

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

„Mosaico is a JavaScript library (or maybe a single page application) supporting the editing of email templates.

The great thing is that Mosaico itself does not define what you can edit or what styles you can change: this is defined by the template.

This makes Mosaico very flexible.“

GitHub

readmore

Nested is a jQuery plugin which allows you to create multi-column and dynamic grid layouts. All completely gap-free.

Nested @ Github

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

Brick.js offers a blazing fast masonry layout generator for fixed width elements.

Brick.js

readmore

okayNav aims to progressively collapse navigation links into an off-screen navigation, instead of doing it for all the links at the same time.

okayNav@GitHub

readmore

Had to use this for one of my latest Syntax Highlighting tweaks, so that I can use an ordered list,  line numbers and still be able to copy & paste the code :)

Enjoy coding…

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