Skip to content

Instantly share code, notes, and snippets.

@warenhaus
warenhaus / qtranslate_hooks.php
Last active May 25, 2017 20:21
qtranslate with the new Visual editor in Wordpress 3.9
<?php // encoding: utf-8
/*Copyright 2008Qian Qin(email : mail@qianqin.de)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@j0shua
j0shua / JSLikeHTMLElement.php
Created April 27, 2011 23:56
JSLikeHTMLElement for php Readability port from http://www.keyvan.net/2010/08/php-readability/
<?php
/**
* JavaScript-like HTML DOM Element
*
* This class extends PHP's DOMElement to allow
* users to get and set the innerHTML property of
* HTML elements in the same way it's done in
* JavaScript.
*
* Example usage:
@hugowetterberg
hugowetterberg / ical-RFC-2445-4.1.php
Last active March 6, 2024 18:28
A useful function for splitting ical content into 75-octet lines, taking multibyte characters into account. See: http://www.ietf.org/rfc/rfc2445.txt, section 4.1
<?php
mb_internal_encoding("UTF-8");
$desc = <<<TEXT
<p>Lines of text SHOULD NOT be longer than 75 octets, (och hör på den) excluding the line break. Long content lines SHOULD be split into a multiple line representations using a line "folding" technique.</p>
That is, a long line can be split between any two characters by inserting a CRLF
immediately followed by a single linear white space character (i.e.,
SPACE, <b>US-ASCII</b> decimal 32 or HTAB, US-ASCII decimal 9). Any sequence
of CRLF followed immediately by a single linear white space character
is ignored (i.e., removed) when processing the content type.